title: Embed C# code in JavaScript?
body: <p>In my <code>.aspx</code> file I have a button </p>
  
  <pre><code>&lt;asp:Button ID="BtnSearch" runat="server" Text="Search" ValidationGroup="SearchRoles" CausesValidation="true" OnClick="BtnSearch_Click" /&gt;
  </code></pre>
  
  <p>Normally in the <code>.cs</code> file if I needed to call any methods for the button I would call <code>BtnSearch.method()</code> but I have a function in the JavaScript for <code>EditClick()</code> and I would like to call <code>BtnSearch.Enable = false</code> but I get an exception. How would I disable this button in the JavaScript function? </p>