Page Method Is Not Executing
===

I am trying to make improvements to a SharePoint 2010 site and am running into difficulties calling a PageMethod. Here is the script I'm attempting to execute:

    <script type="text/javascript">
        function BindingTitle() {
            alert("number one");
            PageMethods.BindTitle(OnSucceeded, OnFailed);
            alert("number two");
        }

        function OnSucceeded(result, userContext, methodName) {
            alert("it worked!");
        }
        function OnFailed(error, userContext, methodName) {
            alert("it didn't work!");
            alert(error);
        }

    </script>

The control tied to the script is within a table but for the sake of brevity, it looks something like this:

    <table>
      <thead>
        <tr>
          <th onclick="BindingTitle()"> alsdjlfajlskdjfla</th> //this is the control
        </tr>
      </thead>
    </table>

and the web method placed in the code behind looks like this:


        [WebMethod()]
        public static void BindTitle()
        {
            Console.WriteLine("things are happening");
        }


The line in the script, "PageMethods.BindTitle(OnSucceeded, OnFailed) is not executing. When the control is clicked, the alert saying "number one" displays, but the "number two" never shows (When the page method is commented out, it does). The only thing I can think of that could be the cause of this is the script manager. It is declared in the master page for this package which is something I do not want to change. But the script manager is used for a lot of different things and I am not familiar enough with the intricacies of web development to know how this affects it on my page. The definition of the script manager looks like this:

      <asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="true" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />

Is there a way I could disable this script manager on my page so I could declare my own, simpler one? It should also be noted that this is a fairly large site with several pages that depend on the previously declared script manager. Most of code for these sites is exceptionally messy and was written by a person who is no longer working for this company. I say this just to clarify that some changes that would affect other pages are not feasible given my available time because of the amount of testing and debugging necessary after such a change.

If I left anything out, please let me know! Thanks!


