G
Guest
I'm having an issue with the "Refresh" of an asp.net page. The refresh is
actually calling my last onClick event. I thought that asp.net was supposed
to be stateless in that it shouldn't remember that I clicked a button before
the refresh. Here is what is going on:
1) Page Loads
2) User enters some values, clicks the "Save" button
3) The onClick event handler for the save button saves the data to the
database and the page is re-displayed with the new results.
*** Everything is fine up until point #4
4) I click the "Refresh" button on my browser (Internet Explorer v6.0).
5) As I step through the code, the execution goes through my Page_Load event
hanlder and my btnSave_onClick event handler.
I don't think it should ever return to my onClick event handler when I
refresh the page. Is their some type of setting or configuration I need to
check. At the page level, I have EnabledViewState = true.
Additional Information (if necessary):
Here is the declaration of my control & my event handler if this helps.
Button declaration in asp.net page:
<asp:Button ID="btnSave" Runat="server" Text="Save" onClick="btnSave_Click"
/>
onClick event handler in code behind page
public void btnSave_Click(object sender, System.EventArgs e)
{
//......
}
actually calling my last onClick event. I thought that asp.net was supposed
to be stateless in that it shouldn't remember that I clicked a button before
the refresh. Here is what is going on:
1) Page Loads
2) User enters some values, clicks the "Save" button
3) The onClick event handler for the save button saves the data to the
database and the page is re-displayed with the new results.
*** Everything is fine up until point #4
4) I click the "Refresh" button on my browser (Internet Explorer v6.0).
5) As I step through the code, the execution goes through my Page_Load event
hanlder and my btnSave_onClick event handler.
I don't think it should ever return to my onClick event handler when I
refresh the page. Is their some type of setting or configuration I need to
check. At the page level, I have EnabledViewState = true.
Additional Information (if necessary):
Here is the declaration of my control & my event handler if this helps.
Button declaration in asp.net page:
<asp:Button ID="btnSave" Runat="server" Text="Save" onClick="btnSave_Click"
/>
onClick event handler in code behind page
public void btnSave_Click(object sender, System.EventArgs e)
{
//......
}