"my cats, Gag and yak" <mr********@comcast.netwrote in message
news:qv******************************@comcast.com. ..
Session variables are
- memory that .net releases when it needs to = none of it is guaranteed
Sounds like you are refering to the Cache not the Session. Session
variables will remain until the session expires.
- useful to store temporary information
- with the intent of
try // the following is pseudo code
clsScrubMyData myScrubber = new clsScrubMyData();
if ( Session["myVar"] == null )
{
++NbrErors;
}
else
{
// the following is not perfect, thus the need for ++NbrErrors and
catch
int abc = myScrubber(Session["myVar']);
and so on
}
catch{ Exception lyBigFish )
{
++NbrErrors;
}
finally
{
if ( NbrErrors != 0 )
{
// you have to reinitialize the Session variable
Session["myVar"] = abcdefgh
and so on
}
}
If code in a page depends on previous pages having set up session variables
a simple test of Session.IsNewSession should be made. If true it would mean
that the previous session is likely to have expired.
--
Anthony Jones - MVP ASP/ASP.NET