On my webpage with a MasterPage, the master page contains the following code:
<ajaxToolkit:ToolkitScriptManager ID="scriptManager"
runat="server"
AsyncPostBackTimeout="99999999"
EnablePageMethods="true" />
The code behind includes this method:
[WebMethod]
public void SavePreference(string graphVersion)
{
//some code here
}
In addition, there is a javascript function:
function lnkLearnHardWayclick(){
if( $("#chkDontShowAgain").attr("checked") == "checked")
{
PageMethods.SavePreference('new');
}
$("#info").hide();
$("#hardWay").show();
}
However, upon clicking the link to activate everything, an error occurs:
Uncaught ReferenceError: PageMethods is not defined