0
我背后方法下面的代码,我想使用的JScriptPageMethods没有定义错误
VB代码
<WebMethod>
Public Shared Function SayHello() As String
Return ("Hello JScript")
End Function
ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function GetMessage() {
var i = PageMethods.SayHello();
document.write(i);
}
setInterval(GetMessage, 500);
</script>
</head>
<body>
</body>
</html>
只有我叫它得到:Uncaught ReferenceError:PageMethods未定义
我试图解决这个问题,但没有办法,需要帮助,请。
感谢名单anmarti,这是现在工作,但我仍然有错误的结果输出是“未定义”。 –
你使用'scriptManager'或'jQuery'吗? – anmarti
是的我正在使用脚本管理器,,,,现在我得到这个消息:无法读取未定义的属性'ajax'。 –