function CallServer()
{
arg = "Cognizant";
//注册回调方法
<%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", null)%>;
}
function ReceiveServerData(result)
{
alert(result);
}
这样我一秒alert()一次。看它的结果,但是过一会就会出出脚本错误,__pendingCallbacks[...].async' 为空或不是对象
我查了一此资料,我的这里面也没有用到变量i,请问大虾们,怎么解决啊。
{
arg = "Cognizant";
//注册回调方法
<%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", null)%>;
}
function ReceiveServerData(result)
{
alert(result);
}
这样我一秒alert()一次。看它的结果,但是过一会就会出出脚本错误,__pendingCallbacks[...].async' 为空或不是对象
我查了一此资料,我的这里面也没有用到变量i,请问大虾们,怎么解决啊。
后台方法也贴出来吧。 public partial class Pages_Chat_Chat : System.Web.UI.Page,ICallbackEventHandler
{
#region ICallbackEventHandler 成员
private string retStr = string.Empty;
public string GetCallbackResult()
{
// throw new NotImplementedException();
return retStr;
} public void RaiseCallbackEvent(string eventArgument)
{
//throw new NotImplementedException();
retStr = new ADO_NET().ChatContent(hf_myName.Value.ToString().Trim(), hf_qCode.Value.ToString().Trim());
}
}
调用的时候却使用了show()
这种情况就会报这个提示错误!
JScript code function test()
{
var arg="1";
<%=this.ClientScript.GetCallbackEventReference(this,"arg","getResult",null) %>
}
或ajax 定时查询数据