Order of Events

W

Wayne Wengert

I have an aspx page with multiple radio button lists and I am all tangled up
in the processing logic. I suspect that I do not understand the correct
order of the various events.

I have autopostback enabled on the radio button lists. When the user clicks
on a selection in one of the radio button lists I trap that in the event
handler and then redirect the user to an appropriate page. If the user press
"Back" and returns to the page the previous selection is still shown and if
he clicks on another selection I still get the same redirect as before - it
is as if the previous event fires again?

I tried adding some logic in the page load area to try to manage this but I
cannot find the right combination.

Specific questions:

- when the user returns via the "Back" button does page load fire again,
and if so - will IsPostBack be true?
- When the user clicks a selection in one of the radio button lists
(autopostback is enabled) does a page postback occur? If so, is that before
or after the radio button selected index event fires?

Appreciate and help here

Wayne
 
S

seanmayhew

The way I understand it when hitting back you're seeing your browsers
cached version of the page and a page load has not occured. If
autopostback is enable and you click the radio button a post back is
occuring. easy way to figure this is to comment out the code for your
radio buttons and add

if (Page.IsPostBack)
{
Response.Write("Page is in postback");
}
else
{
Response.Write("You are in Page Load NO Post Back has occured");
}
 

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,997
Messages
2,570,241
Members
46,832
Latest member
UtaHetrick

Latest Threads

Top