I get an error when I do the following:
if(Session[\"value\"] != null) { // code }
The error i get is this:
Object reference not
The [] is an indexer, it acts like a method on the class.
In this case, Session is null and you cannot perform the indexing on it.
Do this:
if(Session != null && Session["value"] != null) { // code }