function CallServer()
         {              
             arg = "Cognizant";  
             //注册回调方法  
             <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", null)%>;
         }  
  function ReceiveServerData(result)  
        {
            alert(result);
        }
这样我一秒alert()一次。看它的结果,但是过一会就会出出脚本错误,__pendingCallbacks[...].async' 为空或不是对象
我查了一此资料,我的这里面也没有用到变量i,请问大虾们,怎么解决啊。

解决方案 »

  1.   

    我就用这个在后台调一个方法,返回一个结果,然后在前台alert()出来,没别的了,还想要什么信息,
    后台方法也贴出来吧。    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());
        }

      

  2.   

    这个问题,一般都是js,你在调用js时,少了参数比如,你定义的是show(img)
    调用的时候却使用了show()
    这种情况就会报这个提示错误!
      

  3.   

    <a onclick="test()">点击</a>
    JScript code    function test()
        {
               var arg="1";
              <%=this.ClientScript.GetCallbackEventReference(this,"arg","getResult",null) %> 
        }
    或ajax 定时查询数据