js中调用ajax怎么会报命名空间未定义错误
xml代码:
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
cs代码:
namespace xiyangyang
{
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(login));
}
[AjaxPro.AjaxMethod]
public int doLogin(string uname, string upwd)
{
xiyangyang.userinfo_BLL userbll = new xiyangyang.userinfo_BLL();
UserAccounts user = userbll.doLogin(uname, upwd);
if (user != null)
{
Session["user"] = user;
return 1;
}
else
{
return 0;
}
}
}}
引用了AjaxPro.2.dll组件
js:
var login=xiyangyang.login.doLogin(uname,upwd).value;这是调用ajax方法,报xiyangyang未定义错误,即命名空间未定义
求高手帮忙解决,谢谢
------解决方案--------------------
类有命名空间
NamespaceName.login....
aspx 页的 form 加 runat="server"