I have a button on my home page which, when clicked, makes visible a RadioButtonList showing the years of history available. Since this is a new application, only 1 year is currently available in the history.
When you select this year, the page_load fires, then the SelectedIndexChanged event of the RBL fires and it redirects to the appropriate page. So far everything is great.
My problem occurs when the user returns to the home page using the browser back button. It does not fire the Page_Load event, but returns with the RadioButtonList visible and the year selected. If you click any other button on the page, the Page_Load fires, then the SelectedIndexChanged event fires, and the page redirects without ever executing the click event for the button that was clicked.
I tried setting the SelectedIndex to -1 in the SelectedIndexChanged event just before the redirect, but when the page redisplays the value of SelectedIndex is 0 rather than -1 (I assume because that year is selected when the page displays). I can't change the value in the page_load because that fires before the SelectedIndexChanged event and it would change the value when it's a valid event. I can't change it in the click event of the new button because that event never fires before the page is redirected.
I'm stumped. Can anyone help me with an idea of how to either NOT automatically fire the SelectedIndexChanged event or a way to get that index set back to -1 when the user uses the browser back button and the page redisplays?
When you select this year, the page_load fires, then the SelectedIndexChanged event of the RBL fires and it redirects to the appropriate page. So far everything is great.
My problem occurs when the user returns to the home page using the browser back button. It does not fire the Page_Load event, but returns with the RadioButtonList visible and the year selected. If you click any other button on the page, the Page_Load fires, then the SelectedIndexChanged event fires, and the page redirects without ever executing the click event for the button that was clicked.
I tried setting the SelectedIndex to -1 in the SelectedIndexChanged event just before the redirect, but when the page redisplays the value of SelectedIndex is 0 rather than -1 (I assume because that year is selected when the page displays). I can't change the value in the page_load because that fires before the SelectedIndexChanged event and it would change the value when it's a valid event. I can't change it in the click event of the new button because that event never fires before the page is redirected.
I'm stumped. Can anyone help me with an idea of how to either NOT automatically fire the SelectedIndexChanged event or a way to get that index set back to -1 when the user uses the browser back button and the page redisplays?