Thank you for the response. I have posted my event log of an occurrence below, with some site specific information edited out. When the module loads up, I call a subroutine that loads the appropriate control based on a session variable. The modules access is restricted to logged in users, so if their session expires they are redirected to login.
AssemblyVersion: 04.05.01
PortalID: 0
PortalName: *Edited
UserID: 94
UserName: *Edited
ActiveTabID: 97
ActiveTabName: Tech Support
RawURL: /Support/TechSupport/tabid/97/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: https://*Edited/Support/TechSupport/tabid/97/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 1ad3d67f-e17c-4aff-941d-43c3150d423a
InnerException: Value cannot be null. Parameter name: virtualPath
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.VirtualPath.Create
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: virtualPath ---> System.ArgumentNullException: Value cannot be null. Parameter name: virtualPath at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at SBS_DNN_AJAXSupportDeskl.addSubControl() at SBS_DNN_AJAXSupportDeskl.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: WEBPRODUCTION1
Below is my code for loading the subcontrol in the module, again I am kind of new to this and I really appreciate you taking a look.
The AppRelativeVirtualPath="~/" thing has to do with some blogs that I read where people encountered similar issues, it has not fixed my issue.
Sub addSubControl()Me.AppRelativeVirtualPath = "~/"
'testing for session failure
If Session(SDMode) = "" Or Session(SDMode) = Nothing Then
Session(SDMode) =
"TicketView"
End If
'this variable is for part of the path to the control, to allow for easy switching between the test and dnn environment
'just uncomment one line to switch
Dim strEnvPath As String
'strEnvPath = "~\"
strEnvPath =
"~\DesktopModules\SBS_DNN_AJAXSupportDesk\"
Dim ctlPath As String = ""
Select Case Session(SDMode)Case "TicketView"
ctlPath = strEnvPath &
"TicketView.ascx"
Case "UpdateTicket"
ctlPath = strEnvPath &
"UpdateTicket.ascx"
Case "AddTicket"
ctlPath = strEnvPath &
"AddTicket.ascx"
Case "AddCompleted"
ctlPath = strEnvPath &
"AddCompleted.ascx"
End Select
'Creates a control object, assigns it to the control we want and then loads it into the
'PlaceHolder.
controlToLoad =
Me.LoadControl(ctlPath)'We must assign a new id when switching controls
controlToLoad.ID = Session(SDMode)
phMainWindow.Controls.Clear()
controlToLoad.EnableViewState =
True
phMainWindow.Controls.Add(controlToLoad)
End Sub
Private