title: PageMethods is not defined Exception: Does not call the WebMethod in ASP.NET
body: <p>My WebMethod does not get called by the PageMethod call in my Javascript function. Here's the code:</p>
  
  <p><strong>EDIT</strong>
  The Console says:</p>
  
  <pre><code>Uncaught ReferenceError: PageMethods is not defined
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>    function profilefollowbuttonchange(cn) {
          if (cn.className == "profile-page-owner-follow-button") {
                  cn.className = "profile-page-owner-follow-button-active";
                  alert("camefollow");
                  PageMethods.ToggleFollow("follow", onSuccess, onFailure); //Does not trigger
                  alert("camefollow"); //Doesn't get printed
              }
  
              else {
                  cn.className = "profile-page-owner-follow-button";
                  alert("cameunfollow");
                  PageMethods.ToggleFollow("unfollow", onSuccess, onFailure); //Does not trigger
                  alert("cameunfollow"); //Doesn't get printed
              }   
      }
  
  function onSuccess() {
  }
  
  function onFailure() {
  }
  </code></pre>
  
  <p><strong>C#:</strong></p>
  
  <pre><code>[WebMethod]
  public static void ToggleFollow(string command)
  {
         //Does not reach this point. 
  }
  </code></pre>
  
  <p>And yes I have added the <strong>EnablePageMethods="true"</strong> tag in the ScriptManager tag.</p>
  
  <p>However, I have used two WebMethods in the same page for two different purposes (Two different names). Could that be the issue? I hardly think so, but what do yall think?</p>