title: webmethod not working using ajax
body: <p>my .cs code is </p>
  
  <pre><code>auth_reg.aspx.cs (breakpoint shows the method is never reached)
  [WebMethod]
  public void ImageButton1_Click()
  {
      string strScript = "&lt;script language='JavaScript'&gt;alert('working')&lt;/script&gt;";
      Page.RegisterStartupScript("PopUp", strScript);
  }
  </code></pre>
  
  <p>.html code</p>
  
  <pre><code>&lt;asp:ImageButton ID="imgbtnsave" runat="server" Text="Submit" ImageUrl="images/btn-submit1.jpg" src="images/btn-submit1.jpg" onmouseout="this.src='images/btn-submit1.jpg';" onmouseover="this.src='images/btn-submit.jpg';" /&gt;
  
   &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      $('#imgbtnsave').click(function () {
          $.ajax({
              type: "POST",
              url: "auth_reg.aspx/ImageButton1_Click",
              data: '{}',
              contentType: "application/json",
              dataType: "json",
              success: function (msg) {
                  alert('workingajax');
              },
              error: function () {
                  alert('error');
              }
          });          
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>my code is not calling, page just simply get refresh on click</p>