title: Changing button text with Javascript
body: <p>I have the below code:</p>
  
  <pre><code>&lt;asp:Content ID="HeadContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
      &lt;script type="text/javascript"&gt;
          function SetText(id) {
              if (Button2.value == "Disable automatic page refresh")
                  Button2.value = "Automatic Refresh Disabled";
              return false;
          }
      &lt;/script&gt;
  &lt;/asp:Content&gt;
  
  &lt;asp:Button ID="Button2" runat="server" Text="Disable automatic page refresh" OnClick="Button2_Click" OnClientClick="return SetText(this)" /&gt;
  </code></pre>
  
  <p>When I click the button though, the button name does not change, but the code behind C# does still work as normal.  Can anyone point me in the right direction?  I thought it might have been the OnClick event, but after removing it, it still didn't work.  I also tried changing the OnClick to OnServerClick just in case but to no avail.</p>