title: How to get click event in code behind in c# using jquery
body: <p>Hi Please check i want to get click event in code behind as i am using master page concept and i have one child form of it in this page i have ContentPlaceHolder, My button  "btnSubmit" this is a linkbutton which is under GridView. i want loading image when i will click on btnSubmit button. please check and help.</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  function ShowProgress() {
      setTimeout(function () {
          var modal = $('&lt;div /&gt;');
          modal.addClass("modal");
          $('body').append(modal);
          var loading = $(".loading");
          loading.show();
          var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
          var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
          loading.css({ top: top, left: left });
      }, 200);
  }
  $('form').live("submit", function () {
      ShowProgress();
  });
  </code></pre>
  
  <p></p>
  
  <p>aspx page..</p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"&gt;
  &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"&gt;
  &lt;Columns&gt;
      &lt;asp:BoundField DataField="Journal" HeaderText="Customer Id" /&gt;
      &lt;asp:BoundField DataField="ISBN" HeaderText="Contact Name" /&gt;
      &lt;asp:BoundField DataField="Status" HeaderText="City" /&gt;
      &lt;asp:TemplateField HeaderText="Btn"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:Button ID="btnSubmit" runat="server" Text="Load Customers"
  OnClick="btnSubmit_Click"  /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  &lt;div class="loading" align="center"&gt;
  Downloading Files. Please wait&lt;br /&gt;
  &lt;br /&gt;
  &lt;img src="loader.gif" alt="" /&gt;
  &lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>In cs Page.</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          string script = "$(document).ready(function () { $('[id*=btnSubmit]').click(); });";
          ClientScript.RegisterStartupScript(this.GetType(), "load", script, true);
      }       
  }
  </code></pre>