Session Variables and Event Sequences

M

mmbbrwd

I am just beginning to learn ASP.Net and am not connecting on
something related to session variables. Without concern over whether
or not session variables are appropriate here is my disconnect. I
would like to be able to read the value of a session variable when the
page loads as a result of postback. The trigger for storing the
variable is some control event such as a selectedindexchanged event.
The sequence of events (page load before control events) seems to
leave me one trip behind meaning that the variable is not stored to
the session until after the page is reloaded, thus defeating the
purpose of having access to that variable on the page load. What am I
missing here?

Thanks.

mmbbrwd
 
K

kurt.kurtsmith

I am just beginning to learn ASP.Net and am not connecting on
something related to session variables. Without concern over whether
or not session variables are appropriate here is my disconnect. I
would like to be able to read the value of a session variable when the
page loads as a result of postback. The trigger for storing the
variable is some control event such as a selectedindexchanged event.
The sequence of events (page load before control events) seems to
leave me one trip behind meaning that the variable is not stored to
the session until after the page is reloaded, thus defeating the
purpose of having access to that variable on the page load. What am I
missing here?

Thanks.

mmbbrwd

The following event will fire after the control events have fired:

protected void Page_LoadComplete(object sender, EventArgs e)

Hope this helps.
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top