title: ASP.NET Looking to disable Button on click event
body: <p>Hey looking for method to disable button after clicked, but I guess only after it passes validation because need to enter a second time.</p>
  
  <p>EDIT : </p>
  
  <p>Looking for a disable function which does the following<br>
  1) Disables the button onclick<br>
  2) when a user hits the back button in the browser the button is no longer disabled</p>
  
  <p>Currently have</p>
  
  <pre><code>&lt;asp:Button ID="btnProceedStepTwo" runat="server" Text="Proceed &amp;nbsp;&amp;rarr;" CssClass="button" OnClick="btnProceedTwo_Click" /&gt;
  </code></pre>
  
  <p>and in code behind</p>
  
  <pre><code>btnProceedStepTwo.Attributes.Add("onclick", "this.disabled=true;" + GetPostBackEventReference(btnProceedStepTwo).ToString());
  </code></pre>