title: calling a web method from clientside using jquery ajax method - not calling method rather going into pageload
body: <p>I click my edit button,it enters button click function in javascript.When ajax() is executed  the control goes to page load of WebForm rather than directly calling update() of webform which I'm mentioning as [ url: "WebForm1.aspx/update",] in ajax().Why not my update function is invoked ?? 
      I'm having master page for my webform and the button is an asp:control</p>
  
  <pre><code>This is my javascript
  $(document).ready(function () {
  
      $("input[id*='edit']").click(function () {
          var userdata = {};
          userdata["Name"]="Saran";
          var DTO = { 'userdata' : userdata};
          $.ajax({
              type: "POST",
              contenttype: "application/json; charset=utf-8",
              url: "WebForm1.aspx/update",
              data: JSON.stringify(DTO),
              datatype: "json",
              success: function (result) {
                  //do something
                  alert("SUCCESS = " + result);
                  console.log(result);
              },
  
              error: function (xmlhttprequest, textstatus, errorthrown) {
                  alert(" conection to the server failed ");
                  console.log("error: " + errorthrown);
              }
          });//end of $.ajax()
  
          return false;
      });//eof button click
  });
  
  
  and my webform looks like this
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.Services;
  using Payoda.Assignments.BusinessLayer;
  
  namespace Payoda.Assignments.LoginApplication
  {
      public partial class WebForm1 : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
          }
  
          [WebMethod]
          public static string update(string userdata)
          {
              return "success";
          }
      }
  }
  
  
  my aspx page looks like this
  
  &lt;%@ Page Title="" Language="C#" MasterPageFile="~/MyMasterPage.Master" AutoEventWireup="true" CodeBehind="TrialPage.aspx.cs" Inherits="Application.TrialPage" %&gt;
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
      &lt;script src="Scripts/jquery-1.10.2.js"&gt;&lt;/script&gt;
      &lt;script src="Scripts/TrialScript.js"&gt;&lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="Contents" runat="server"&gt;
      &lt;asp:Button ID="editLink" runat="server" Text="MY BUTTON" /&gt;
  &lt;/asp:Content&gt;
  </code></pre>