I have two radio button on my asp.net page, with AutoPostBack = True
When I click on either of those, they each set a flag SaveData=False
However, when I click on them, the page_load event occurs first, so the page_load event saves the data, then the radiobutton_OnCheckedChanged event is triggered.
How can I trigger the OnCheckedChanged before the page_load event?
You can’t trigger the
OnCheckedChangedbeforeradiobutton_OnCheckedChangedbecause that’s the normal page life cycle.You can check in Page_Load if
Page.IsPostBackis true or not, and then don’t save (or save) the data.