May 21, 2018 10:49 AM|0belix|LINK
Thx for the reply.
I can't place here the full code as there are hundreds of code lines on it.
The code i posted is a simplification as it illustrates where the issue is happening. The only thing i just mentioned in a rush and did not provide details was the following:
The project was initially developed before the launch of masterpages, so we simulate them by using a default page where the menu, and all other elements that repeat from page to page get centralized, and then we capture from the URL the control to load by
retrieving the querystring "ctrl". After getting the requested control, we load it on the default.aspx page_load using the following code:
Dim recievedCtrl As String = Request.Params("ctrl")
If recievedCtrl <> "" Then
If recievedCtrl = "default" Then
Me.toLoadControlContent = LoadControl(recievedCtrl & ".ascx")
Me.toLoadControlContent = LoadControl("home.ascx")
This is where the code i posted earlier comes into action, since it is placed inside a usercontrol, as explained, that is called using the above method.
My only guess is that the page cycle gets messed up when loading the control using this approach, but i'm not sure if that is the case, or how to overcome this without rebuilding the whole page and possibly the project, and that is not an option at this
I can also add that we are using the 4.0 framework under IIS 10.0.16299.15
Does this help you helping me in any way?