Hi everyone. I have a problem with configuring some files after upgrade to DNN 9.10.2. First of all, we had some custom skins with code blocks <% .. %> in it and I solved loading skins problem with adding <asp:PlaceHolder runat="server"> <% %> .
BUT, new problem occured when I added our custom code we used in older versions written in Default.aspx.
So, as GetRolesByUser is deprecated in DotNetNuke 6.2 I didn't find exactly with which one method to replace it? Found this: https://dnncommunity.org/forums/aft/1119 but I'm not sure if this would work? I tried with: UserController.GetUserById(PortalSettings.PortalId, DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo().UserID).Roles;
but then I get
When I delete any code in <asp:PlaceHolder runat="server"><% ..code.. %> my page loads fine. Like it won't work with code between block <asp:PlaceHolder runat="server"><% .... %>
Any ideas?
Also, I was wondering, regarding Telerik component vulnerability.. As we use several third party modules with Telerik and, for now, removing Telerik is not an option (but it definetly will be in future), I tested uninstalling Telerik from DNN and removing any references from web.config as described in documentation but copying back Telerik dll's to bin folder. So, just copying back dll's, with no references anywhere in config. In that case, our modules that user Telerik work, so I was wondering is there a way that this solution might be some kind of workaround to keep using Telerik without some security issues??
Did you follow the DNN Platform Suggested Upgrade Path or did you upgrade directly?
Did you check all the requirements? (.Net Framework version etc.)
Happy DNNing! Michael
I did follow upgrade path but any c# code written in Default.aspx just breaks page... It worked in old version we had.
Also, I upragded DNN to 9.10.2 version so that's why I'm trying to remove Telerik references but because removing Telerik from our third party is not an option in the moment I just wonder would my solution that was described in last post be kind of effective because our modules work with just Telerik dll's and with no references in web.config or elsewhere except our custom modules...
Oh, I completely missed a critical detail about your post... You're trying to change the core code of DNN by editing the Default.aspx. I'm afraid any change to the core code of DNN is not technically supported and is not tested as a result.
If you need to edit the Default.aspx, we'd suggest finding any other way to add code. There are numerous options to avoid this, including a theme object, adding code to the theme, and some third-party modules help do this.
So, I'm not sure you'll find a lot of information about how to safely edit the Default.aspx. Sorry. :(
The themes shouldn't necessarily need any editing just to upgrade DNN - at least not the type of edits you described. If that edit was necessary, it might be best to show an example. However, as long as general ASP.NET coding practices are followed, almost anything you can do in a custom ASCX or ASPX page can be done in your theme.
Well, I managed to get it work but now I have some strange problem, when I'm logged in everything loads normally, but when I'm not logged in site just breaks. I get "Application Error".
Log says nothing specific:
DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ASP.default_aspx.__RenderBody(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer) at DotNetNuke.Framework.DefaultPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I solved the problem by adding <% If Request.IsAuthenticated %>. Now everything works as expected.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.