AjaxPro.2.dll使用中出现页面未定义错误的解决办法

在使用AjaxPro.2.dll时,web.config中加入:

    <httpHandlers>
      <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
    </httpHandlers>

aspx.cs中 “AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));” 注册,但在调用时会出现页面未定义错误。

我的解决办法的把命名空间也加上。这样就可以使用了。

还有重要的一点:调用js函数时,必须在form内。

例:

//ST_UserAdd.aspx.cs

 

namespace STGROUP.ST_WebExam.ST_User
{
 /// <summary>
 /// ST_StudentAdd 的摘要说明。
 /// </summary>
 public partial class ST_UserAdd : System.Web.UI.Page
 {

  protected void Page_Load( object sender , System.EventArgs e )
  {
   // 在此处放置用户代码以初始化页面
   Response.Cache.SetCacheability( HttpCacheability.NoCache );//去掉页面缓存
            AjaxPro.Utility.RegisterTypeForAjax(typeof(STGROUP.ST_WebExam.ST_User.ST_UserAdd));
              }
  }

//...

 }

 }

ST_UserAdd.aspx

//...

var ds = STGROUP.ST_WebExam.ST_User.ST_UserAdd.SearchTxt(txtobj.value).value;

//...

你可能感兴趣的:(object,user,Class,Path)