I have a page with a MasterPage, in the master page, I have this:
<ajaxToolkit:ToolkitScriptManager ID="scriptManager"
runat="server"
AsyncPostBackTimeout="99999999"
EnablePageMethods="true" />
And I have this method in the code behind:
[WebMethod]
public void SavePreference(string graphVersion)
{
//some code here
}
And then I have this javascript function:
function lnkLearnHardWayclick(){
if( $("#chkDontShowAgain").attr("checked") == "checked")
{
PageMethods.SavePreference('new');
}
$("#info").hide();
$("#hardWay").show();
}
But when I click on the link to make everything work, I get this error:
Uncaught ReferenceError: PageMethods is not defined
I have a page with a MasterPage, in the master page, I have this:
<ajaxToolkit:ToolkitScriptManager ID="scriptManager"
runat="server"
AsyncPostBackTimeout="99999999"
EnablePageMethods="true" />
And I have this method in the code behind:
[WebMethod]
public void SavePreference(string graphVersion)
{
//some code here
}
And then I have this javascript function:
function lnkLearnHardWayclick(){
if( $("#chkDontShowAgain").attr("checked") == "checked")
{
PageMethods.SavePreference('new');
}
$("#info").hide();
$("#hardWay").show();
}
But when I click on the link to make everything work, I get this error:
Share Improve this question edited Nov 18, 2011 at 21:14 Joel Coehoorn 416k114 gold badges578 silver badges813 bronze badges asked Nov 18, 2011 at 19:51 NahuelNahuel 331 silver badge3 bronze badgesUncaught ReferenceError: PageMethods is not defined
1 Answer
Reset to default 6PageMethods
are not supported in master pages and user controls.