你有在PAGE_LOAD 時宣告這個嗎?
AjaxPro.Utility.RegisterTypeForAjax(typeof(PAGE_NAME));

解决方案 »

  1.   

    写了,不写ajaxTest.ServerSideAdd也不会有返回值
      

  2.   

    Utility.RegisterTypeForAjax(typeof(PAGE_NAME), this.Page);
      

  3.   

    用ScriptManage吧
    <asp:ScriptManager ID="ScriptManager2" runat="server"  EnablePageMethods="true" />  在这里要加上EnablePageMethods="true"属性
    在JS中用
    function xx()
    {
      ....
     PageMethods.ServerSideAdd(s1,s2,..,ReturnValue)     //这里的s1,s2中参数,ReturnValue是函数
    }
    function ReturnValue(result)
     {
       alert(result);
     }C#: 
            [System.Web.Services.WebMethod]
            public   int   ServerSideAdd(int   firstnumber,   int   secondnumber) 
            { 
                    return   firstnumber   +   secondnumber; 
            } 
    这样绝对可以正确返回数据