应用ajax.dll 在前台应用的时候报错,说类名未定义???
后台页面
public partial class BasicInformation_Permission : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(BasicInformation_Permission));
}
[Ajax.AjaxMethod()]
public string[] GetData(string wec_id)
{
return "123"
}
前台 <form id="frmBasicInformation_Permission" runat="server"》
var pArray= Web.BasicInformation_Permission.GetData(val["类别id"]);
webconfig <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
报错 BasicInformation_Permission 未定义。
大神们帮帮忙呗!
------解决方案--------------------
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
<script type="text/javascript" src="/SAAS_WEB/ajax/(pviywl45q5t2yx55vu33gj55)/common.ashx"></script><script type="text/javascript" src="/SAAS_WEB/ajax/(pviywl45q5t2yx55vu33gj55)/BasicInformation_Permission,App_Web_wyiajjiq.ashx"></script>
你设置的Cookieless造成了路径匹配失败。
web.config中的handler配置的路径ajax/*.ashx没法匹配ajax/(pviywl45q5t2yx55vu33gj55)/common.ashx