Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Sessions

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I am trying to read a session variable with:

String sn = Session["uname"];

Now this session has not been set, so I was hoping to get "undefined", instead I get the following error:

Cannot implicitly convert type 'object' to 'string'

How do I read a session vars value?

[conehead]
 
nevermind - I got it:

String sn = (string)Session["uname"];

[conehead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top