I have an application in which I store state in the Session object. There
are two paths of execution in the Page_Load method of the default page. In
one path the Session state is preserved across postback and it works fine.
In the other path the Session state is lost and I get a new Session object
after the postback. The page has a grid on it and I am using a List<T> as a
datasource for the grid that is stored in the Session state and is to be
recovered on postbacks. The handler on the postback is to recover objects in
the data source that correspond to selections in the grid. When the Session
is lost I, obviouslly have problems in the handler.
What can cause loss of Session? I am not calling Abandon.
> In the other path the Session state is lost and I get a new Session
> after the postback. The page has a grid on it and I am using a
List<T> as a
are you modifying the content of your website's root directory? I had
that once with an xml file that I modified there, which caused the
application to restart. I think the solution was to move the xml file
into a subdirectory. That is apparently a new behaviour in ASP.NET 2.0.
Otherwise or if this doesn't help, check the event log, maybe there is
something helpful in it.