title: PageMethods is not defined
body: <p>I am setting up PageMethods to access server side code using javascript. I am receiving the error "PageMethods is not defined" when i debug using firebug. the server side code is not being fired as well.</p>
  
  <p>I have setup my script manager "EnablePageMethods" to true. My method is public &amp; static and it has the WebMethod attribute set up as well. Still i m receiving the above error. Can it be because of the script manager being in a top level master page which has two child master pages and then my page is called:</p>
  
  <p>i.e.</p>
  
  <p>Main Master Page (with script manager) -> Primary master page -> Secondary master page -> My page -> My User control (having the WebMethod)</p>
  
  <p>Is it possible tht the hierarchy is causing this issue?</p>
  
  <p>This is the webmethod</p>
  
  <pre><code> [System.Web.Services.WebMethod]
  public static void AddNote(string t)
  {
      int propid = 1; 
      if (propid &gt; 0)
      {
       //Call my method
      }
  }
  </code></pre>
  
  <p>this is my javascript code:</p>
  
  <pre><code>  function editNodes(t) {
      alert('test1');
      alert(t);
      PageMethods.AddNote(t,OnSuccess,OnFailure);
      alert('method called');
  }
  function OnSuccess() { 
      alert('Success'); 
      if (!navigator.appName == 'Microsoft Internet Explorer') {
          window.location.href = window.location.href;
      }
  
  }
  function OnFailure(error) {
      alert('Error:' + error);
  }    
  </code></pre>
  
  <p>this is where I am calling it:</p>
  
  <pre><code>   &lt;a href="#" class="btngeneral" onclick="javascript:editNodes(2);"&gt;Save&lt;/a&gt;
  </code></pre>