关于ajaxPro.2 使用出错(未定义)的解决

今天在使用ajaxpro.2的时候,按照网上的文章,

1.引用ajaxPro.2.dll 文件

2.在web.config中的<system.web>内写:
  <httpHandlers>
   <add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
  </httpHandlers>
  <compilation debug="true"/>

3.在页面后台 protected void Page_Load(object sender, EventArgs e){}函数内注册ajaxpro

AjaxPro.Utility.RegisterTypeForAjax(System.Type.GetType("页面命名空间,如:_default"));

4.在要引用的方法头部加入[AjaxPro.AjaxMethod]

5.页面前台js调用写

    <script type="text/javascript">      

   function deleteRow(aid) {            

    hr_bsAbout.aaa("1");     

//如果是在项目下建了一个文件夹,那么必须将,下面命名空间写全,否则会出现 "页面名未定义"或"未将页面引用到实例一类的错误"       ,同样的,在后台page_load中注册ajaxpro时,typeof()括号内也必须写全命名空间,如果有母版页时,那个括号里还应写第二个参数, this.page , 这是在asp.net application时, 在website中我还没有尝试, 我用的是vs2010

     var s = HospitalRegist.backSystem.hr_bsAbout.aaa("1");                

     alert(s.value);

            }        

};     </script>

 

原文地址:https://www.cnblogs.com/wangjiquan/p/2678805.html