Order of Events

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
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
 
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");
}
 
Back
Top