Results 1 to 3 of 3

Thread: how to test if a session variable exists ?

  1. #1

    Thread Starter
    Hyperactive Member fabianus's Avatar
    Join Date
    Sep 2004
    Location
    Paris
    Posts
    402

    Question how to test if a session variable exists ?

    1) How may I test if HttpContext.Current.Session("my_MenuItem") exists
    2) and if HttpContext.Current.Session("my_MenuItem") exists, how may I test if an object is allready attributed or if the variable is empty.

    Thank you very much for your help!

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: how to test if a session variable exists ?

    Quote Originally Posted by fabianus
    1) How may I test if HttpContext.Current.Session("my_MenuItem") exists
    2) and if HttpContext.Current.Session("my_MenuItem") exists, how may I test if an object is allready attributed or if the variable is empty.

    Thank you very much for your help!
    VB Code:
    1. If Session("my_MenuItem") Is Nothing Then
    2.     ' Empty
    3. Else
    4.     ' Not Empty
    5. End If

  3. #3

    Thread Starter
    Hyperactive Member fabianus's Avatar
    Join Date
    Sep 2004
    Location
    Paris
    Posts
    402

    Resolved Re: how to test if a session variable exists ?

    thank you !!

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