title: Calling an ASP.NET EventHandler from JavaScript
body: <p>I have a traditional ASP.NET Web Form. We used to have a button defined as follows:</p>
  
  <pre><code>&lt;asp:Button ID="myButton" Runat="server" OnClick="myButton_Click" /&gt;
  </code></pre>
  
  <p>In the .aspx.cs page, I have the following:</p>
  
  <pre><code>protected void myButton_Click(object sender, EventArgs e)
  {
    // Do Stuff
  }
  </code></pre>
  
  <p>However, now someone has decided to use a fancy JavaScript framework. Essentially, I just have:</p>
  
  <pre><code>  &lt;input type="button" id="myButton" onclick="someJSFunction()" /&gt;
    &lt;script type="text/javascript"&gt;
      function someJSFunction() {
        // Need to execute "myButton_Click" here.
      }
    &lt;/script&gt;
  </code></pre>
  
  <p>How do I actually execute my original method on the server from here? I know this is a very bizarre question. I've simplified the code to try to and be a direct in communicating what I'm trying to accomplish. Can someone please tell me how to do this?</p>
  
  <p>Thank you so much!</p>