Session Data Set disappears on second page load

D

Darril Gibson

I'm porting over an ASP .NET application from ASP .Net 1.0 to 2.0. I've had
a variety of issues that I've been able to solve, but this one has me
stumped.

I have a data set with three data tables. I load it into session state on
an earlier page with
Session("DS") = ds

In my target page, I bind a table from the session dataset to a GridView and
everything looks fine - but only the first time through.

When I click any button causing a round trip to the server and redisplaying
the page, the data set is no longer in session state and gives me a null
reference exception error.

However, a message box test before the bind shows me that other session
state data such as the user name is still present.

I've eliminated all subroutines on the target page except the Page Load. I
have the same resultes so it doesn't seem to be a code issue.

On the target page, I've toggled EnableSessionState (true, false, and
readonly). False loses the dataset the first time through as expected.
True and ReadOnly give the above error.

I've modified the Web.Config file by adding
<sessionState mode="InProc" />
and
<pages buffer="true">

Anyone have any ideas?

Darril Gibson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top