I have the following test:
if(Session["mykey"] != string.Empty)
{...}
In VS.NET 2010’s watch window, the value of Session[“mykey”] is “”. Yet I still go into the conditional. Do I need some other test?
— EDIT —
After the above runs, I do reset the object by assigning string.Empty.
Of course, because you are comparing with the
objectof theSessionsnot itstext.Do like so:
other way to go is: