I have an ASP.NET button that takes 1-2 seconds of server side processing. To prevent multiple clicks, I disable the button like below:
<asp:Button Text="Click Me" runat="server" ID="btnClickMe" OnClick="btnClickMe_Click" UseSubmitBehavior="false" OnClientClick="this.disabled = true;" />
protected btnClickMe_Click(object sender, EventArgs e)
{
Thread.Sleep(2000); // Simulate work
Response.Redirect("AnotherPage.aspx");
}
How can I re-enable the button when the user clicks the browser's back button?
I tried setting the button enable to true in the Page_Load event but that didn't work.