Verify if Session(hashtable) exists

  • Thread starter Thread starter Carlos Albert
  • Start date Start date
C

Carlos Albert

Hello everybody,

I have SHOULD have a hashtable stored in a Session. How can I verify it such
session really exists? I tried to use these sentences but ASP.NET doesn't
like them, it says that session("hashtable") is not a string, or boolean...

if session("hashtable") then ...

if session("hashtable") <> "" then ...
 
You can ennumerate the Session.Keys collection.
Unfortunately it does not provide a "contains" function

-- addup --
 
Oh, I found the way:

Dim xx as hashtable = session("hashtable")
if not xx is nothing then ...

Tnx everybody =)
 
ah -- I must have misunderstood the question

for VB.NET

If HttpContext.Current.Session Is Nothing Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top