CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005
    Posts
    2

    Question VaryByCustom to retrieve SessionID problem

    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

  2. #2
    Join Date
    Mar 2005
    Posts
    2

    Re: VaryByCustom to retrieve SessionID problem

    I still can't get this working - any suggestions please?

    Mel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured