Calling Pagemethod
<p>Hi i have the following pagemethod, however it dues not seem to be working, i tried debugging it and it does not hit the method. Here is what my method looks like;</p>

<pre><code>function InsertStatus() {

  var fStatus = document.getElementById('&lt;%=txtStatus.ClientID %&gt;').value;
  PageMethods.InsertStatusUpdate(fStatus, onSucess, onError);

  function onSucess(result) {
      alert(result);
  }

  function onError(result) {
      alert('Cannot process your request at the moment, please try later.');
  }
}
</code></pre>

<p>And my codebehind;</p>

<pre><code>    [WebMethod]
    public static string InsertStatusUpdate(string fStatus)
    {
        string Result = "";
        int intUserID = -1;

        if (String.IsNullOrEmpty(HttpContext.Current.User.Identity.Name))
          HttpContext.Current.Response.Redirect("/login");
        else
            intUserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

        if (string.IsNullOrEmpty(fStatus))
            return Result = "Please enter a status";
        else
        {

            //send data back to database

            return Result = "Done";

        }

    }
</code></pre>

<p>When i click my button it goes straight through the onError Method. Can anyone see what i am doing wrong?
I found the problem i needed a    [System.Web.Script.Services.ScriptService] above the method, due to the fact it is being called by a script. Thanks for all the suggestions.</p>
