And BTW, on the server side, the Session ALWAYS exists - unless it takes
longer than 20 minutes for the Page to process. Just want to make sure
there's no confusion between the Session Collection and its members.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"Shiva" <sh******@online.excite.com> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
First, check for the existance of the item in the session state collection
before accessing its properties:
if (Session["name"] == null)
{
// name does not exist in the Session state collection.
}
else
{
// Access Session["name"] here...
}
Hope I got the question correctly.
"Green" <so*****@yahoo.com> wrote in message
news:opsd4iwaxppk4u20@dev-02... Hi,
I want to test whether a sesion exist, what can i do?
I use Session["name"].toString().length == 0 , but it will prompt the
error saying object is not referenced. How can i test Session["name"]
exist?
Thanks in advance!