C
Craig G
i have the code in the Page_load event of a toolbar (usercontrol)
If Not Page.IsPostBack Then
If Session("SecurityInfo") Is Nothing Then
Response.Redirect("Default.aspx")
End If
lblUserName.Text = Session.Item("SecurityInfo").UserFullName
lblUserRole.Text = Session.Item("SecurityInfo").Role
subFillProfessionCombo()
RaiseEvent SecurityDetailsLoaded()
Dim strName As Array
strName = Split(Request.ServerVariables("URL").ToString(), "/")
Session("CurrentPage") = strName(UBound(strName))
End If
every so often it falls over on
If Session("SecurityInfo") Is Nothing Then
Response.Redirect("Default.aspx")
End If
and returns the following error
Run-time exception thrown : System.Web.HttpException - Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive
i'm kinda baffled as to why its only falling over sometimes and other times it works fine. and i dont know where to set enableSessionState = true
If Not Page.IsPostBack Then
If Session("SecurityInfo") Is Nothing Then
Response.Redirect("Default.aspx")
End If
lblUserName.Text = Session.Item("SecurityInfo").UserFullName
lblUserRole.Text = Session.Item("SecurityInfo").Role
subFillProfessionCombo()
RaiseEvent SecurityDetailsLoaded()
Dim strName As Array
strName = Split(Request.ServerVariables("URL").ToString(), "/")
Session("CurrentPage") = strName(UBound(strName))
End If
every so often it falls over on
If Session("SecurityInfo") Is Nothing Then
Response.Redirect("Default.aspx")
End If
and returns the following error
Run-time exception thrown : System.Web.HttpException - Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive
i'm kinda baffled as to why its only falling over sometimes and other times it works fine. and i dont know where to set enableSessionState = true