title: Unable to access a webmethod from Javascript
body: <p>I was creating a simple web method to access from Java script..But I am not able to</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="Scripts/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  
  
          $(document).ready(
          function test() {
              var x = PageMethods.MyMethod();
              alert(x.toString());
          })
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true"&gt;
          &lt;/asp:ScriptManager&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Code behind looks like this</p>
  
  <pre><code> [WebMethod]
          public static string MyMethod()
          {
              return "Hello";
          }
  </code></pre>
  
  <p>Variable x is null. Iam not able to figure out what is is that Iam missing ?Any help ? Thanks in Advance </p>