admin管理员组文章数量:1326081
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.
本文标签: javascriptPageMethods not definedStack Overflow
版权声明:本文标题:javascript - PageMethods not defined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742195299a2430968.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论