Mel_P
March 2nd, 2005, 05:30 PM
I am trying to understand this from a book but can't seem to get the VaryByCustom="sessionID" in the page directive to work. I have this in global.asax;
Public Overrides Function GetVaryByCustomString(ByVal context As HttpContext, ByVal arg As String) As String
If arg = "SessionID" Then
Return "SessionID=" & Request.Cookies("ASP.Net_SessionID").Value
End If
End Function
which if I use a breakpoint and hover over "GetVaryByCustomString" has the correct value string "SessionID=......." BUT in the aspx page I can't seem to retrieve this value.
It is suggested the value is retrieved in Session.sessionID but this gives the sessionID on its own not the string generated in the function (starting SessionID= .....).
How do I retrieve the string value please? Thanks
Mel P
Public Overrides Function GetVaryByCustomString(ByVal context As HttpContext, ByVal arg As String) As String
If arg = "SessionID" Then
Return "SessionID=" & Request.Cookies("ASP.Net_SessionID").Value
End If
End Function
which if I use a breakpoint and hover over "GetVaryByCustomString" has the correct value string "SessionID=......." BUT in the aspx page I can't seem to retrieve this value.
It is suggested the value is retrieved in Session.sessionID but this gives the sessionID on its own not the string generated in the function (starting SessionID= .....).
How do I retrieve the string value please? Thanks
Mel P