A
Ant
Hi,
I'm experimenting with the session state to see how it works. I'm trying to
increment with every page load. When I try to do this, I get an error
indicating that the page state object is either null or not instantiated. I
can't seem to get around this.
Below is the code I'm using:
Page.Session["MyInc"] = Int32.Parse((Page.Session["MyInc"].ToString()))+1;
labelOP.Text = Page.Session["MyInc"].ToString();
It's ok when I build, just when I run do I get the error.
Why does this not work?
Many thanks for helping me understand how to use this correctly
Ant
I'm experimenting with the session state to see how it works. I'm trying to
increment with every page load. When I try to do this, I get an error
indicating that the page state object is either null or not instantiated. I
can't seem to get around this.
Below is the code I'm using:
Page.Session["MyInc"] = Int32.Parse((Page.Session["MyInc"].ToString()))+1;
labelOP.Text = Page.Session["MyInc"].ToString();
It's ok when I build, just when I run do I get the error.
Why does this not work?
Many thanks for helping me understand how to use this correctly
Ant