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" <> wrote in message news

psd4iwaxppk4u20@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!