![]() |
session values lost in release mode
Hi,
When i execute application in debug mode it works but on release mode the session values in the website is lost. I use windows server 2003 and IIS 6. It is a 5 step enrollment process whose values are carried forward across pages. It throws error "object reference not set to instance of object and points to session values" when moving across pages in release mode. Pls advise. Thanks Priya |
Re: session values lost in release mode
"my cats, Gag and yak" <mrbikejoc1@comcast.net> wrote in message
news:qv6dna7YkKdNw03VnZ2dnUVZ_uOdnZ2d@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 |
Re: session values lost in release mode
"Priya" <Priya@discussions.microsoft.com> wrote in message
news:5064B702-253F-4A7F-8566-6B50258E1023@microsoft.com... > Hi, > > When i execute application in debug mode it works but on release mode the > session values in the website is lost. I use windows server 2003 and IIS > 6. > It is a 5 step enrollment process whose values are carried forward across > pages. It throws error "object reference not set to instance of object and > points to session values" when moving across pages in release mode. What exactly do mean by debug mode and release mode? -- Anthony Jones - MVP ASP/ASP.NET |
| All times are GMT. The time now is 10:25 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.