超级奇怪,以前从来没有碰到过
<httpHandlers>
<add verb="*" path="*/ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
web.config里面的配置
这个是JS:
function changObj(keyid,value)
{
var o=this;
var data;
this.getData = function()
{
return data;
}
this.change_cn = function()
{
AjaxPage.ChangeKCN(keyid,value,o.CallBack); //请注意这步,错误在这里,AjaxPage未定义 }
this.CallBack = function(res)
{
data = res.value;
if(data!="" )
{
document.getElementById(""+ keyid +"kcn").value=data;
}
else
{
alert("Error");
}
}
}
function changeKcn(str,id)
{
alert(str,id);
var obj = new changObj(id,str);
obj.change_cn();
}
这个是CS文件里的代码
public partial class AjaxPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxPage));
}
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
public string ChangeKCN(string keyid, string value)
{
return "aa";
}
}
我在网上搜了下,form是runat="server" 我用的是XP的系统。。。 到底是怎么回事呢,请前辈帮帮我这个菜鸟
------解决方案--------------------
<location path="ajaxpro">
<system.web>
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
<!--
If you need to have Ajax.NET Professional methods running on the
login page you may have to enable your own authorization configuration
here.
-->
<!--
<authorization>
<deny users="?"/>
</authorization>
-->
</system.web>
</location>
------解决方案--------------------
后台类出现了错误 你看下吧
------解决方案--------------------