title: Trigger Jquery event from ASP.NET server-side code?
body: <p>I have a simple JQuery enabled ASP.NET page:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function() {
      $("#accordion").accordion();
    });
    &lt;/script&gt;
  
  &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
      &lt;ContentTemplate&gt;
          &lt;div id="accordion"&gt;
              &lt;h3&gt;&lt;a id="Accordion1" href="#"&gt;Accordion Panel 1&lt;/a&gt;&lt;/h3&gt;
              &lt;div&gt;
                  A form input...
                  &lt;asp:Button id="btnSubmit" runat="server" onclick="btnSubmit_Click" /&gt;
              &lt;/div&gt;
              &lt;h3&gt;&lt;a id="Accordion2" href="#"&gt;Accordion Panel 2&lt;/a&gt;&lt;/h3&gt;
              &lt;div&gt;
              Some content...
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>If you'll notice, I'm using an UpdatePanel also.</p>
  
  <p>btnSubmit_Click event does something like this:</p>
  
  <pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
  {
      //Some MySql INSERT, etc.
  }
  </code></pre>
  
  <p>Now what I want to do is for server-side <strong>btnSubmit_Click</strong> to trigger JQuery to "click" Accordion Panel 2 (so it will open Accordion Panel 2 and close 1). How to do this?</p>
  
  <p>UPDATE: Sorry guys I forgot to mention earlier that It's got an UpdatePanel</p>