I had got the error when I tried to use pagemethods in SharePoint. I had registered the AjaxControlToolkit namespace in masterpage and then I replace ScriptManager with AjaxControlToolkit’s ToolkitScriptManager as shown below:
<ajaxToolkit:ToolkitScriptManager id="ScriptManager" runat="server"
The problem was I enabled the pagemethods by setting EnablePageMethos to true. Disabling the pagemethods fixed the issue. However I didn’t explore why there’s the error if pagemethods is enabled.
So disable the pagemethods by setting EnablePageMethods=”false” and then then error will disappear…