Keeping an object from being recreated and added to Session on page load/postback

A

Andy B

I have the following code inside a page_load event:

DataSet Store = new DataSet();
Session["Store"]=Store;

Every time the page loads, refreshes or the wizard flips from 1 wizardstep
to another, the dataSet is wiped out and reasigned to the Session making it
impossible to get anywhere. How do you stop stuff like this?
 
G

gerry

if ( Session["Store"] == null )
{
DataSet Store = new DataSet();
Session["Store"]=Store;
}
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top