title: Calling an ASP.NET server side method via jQuery
body: <p>I'm trying to call a server side method from client side via jQuery. My code is as follows:</p>
  
  <p>Server side:</p>
  
  <pre><code>    using System.Web.Services;
      [WebMethod()]
      //[ScriptMethod()]
      public static void SendMessage(string subject, string message, string messageId, string pupilId)
      {
          //Send message
      }
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>$("#btnSendMessage").live("click", function(){
    var subject = $("#tbSubject").val();
    var message = $("#tbMessage").val();
    var messageId = $("#hdnMessageId").val();
    var pupilId = $("#hdnPupilId").val();
  
    $.ajax({
        type: "POST",
        url: "./MessagePopup.aspx/SendMessage",
        data: ("subject=" + subject + "&amp;message=" + message + "&amp;messageId=" + messageId + "&amp;pupilId=" + pupilId),
        error: function(XMLHttpRequest, textStatus, errorThrown){
            alert(textStatus);
        },
        success: function(result){
           alert("success");
        }
     });
     return false;
  });
  </code></pre>
  
  <p>I've added a break point on the server side SendMessage method, but it's never hitting it, but when I run the code the jQuery success method is called. What could be causing this?`</p>