if (!Page.IsPostBack)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(Index));
}[AjaxPro.AjaxMethod]
public int getClose()
{
int i = 0;
try
{
i = bll.getClose(loginusername);
}
catch (Exception ess)
{ throw new Exception(ess.Message);
}
return 1; }这个是cs 申明的ajax function check()
{
showMsg();
count++;
Index.getClose( "1",setReturn);
setTimeout("check()",3000);
}
在前台 调用Index 的时候 说Index 没有定义 是怎么回事?
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(Index));
}[AjaxPro.AjaxMethod]
public int getClose()
{
int i = 0;
try
{
i = bll.getClose(loginusername);
}
catch (Exception ess)
{ throw new Exception(ess.Message);
}
return 1; }这个是cs 申明的ajax function check()
{
showMsg();
count++;
Index.getClose( "1",setReturn);
setTimeout("check()",3000);
}
在前台 调用Index 的时候 说Index 没有定义 是怎么回事?
解决方案 »
- 求自动提示框功能实现思路
- Sql 查询问题求解,在线等!
- 如何用正则表达式实现C#后台给前台的指定的html标签中的img路径添加上服务器端路径
- CMailServer的问题
- 怎么做一个china-pub类似的匿名访问的历史记录
- 发送邮件总是不成功,郁闷了
- 如何解决水晶报表的“丢失参数字段当前值”的错误?急急急(在线等)
- 旅游网的数据库设计,我设计的不是很好,希望有经验者给些建议
- 请问 我的VsualStudio 每行代码前面怎么有那么多点
- 求助asp.net问题!在textBox中如何控制数字的位数!
- C#邮件问题。错误提示:邮箱不可用。 服务器响应为: Óû§±»Ëø¶¨
- 高手帮忙在asp.net下GridView右键弹出快捷菜单怎么解决?
有没有申明命名空间
要在<system.web>下加入
<httpHandlers>
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>
{
public int getClose()
{
}
}
Ajax.Utility.RegisterTypeForAjax(typeof(AjaxMethod));AjaxMethod.getClose();
getClose() 是否在index类里
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
</httpHandlers>
你传两个参数Index.getClose( "1",setReturn);
但cs文件却没有参数public int getClose() ,它怎么能调用!
public int getClose()
{
int i = 0;
try
{
i = bll.getClose(loginusername);
}
catch (Exception ess)
{ throw new Exception(ess.Message);
}
return 1; }
改为
public int getClose(int i)
{
try
{
i = bll.getClose(loginusername);
}
catch (Exception ess)
{ throw new Exception(ess.Message);
}
return 1; }
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
</httpHandlers> 这个在配置文件也有但是index 就是说没有定义
你在服务器端改为getClose(string i)
if (!Page.IsPostBack)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(Index));
}
改为
AjaxPro.Utility.RegisterTypeForAjax(typeof(Index));
确保Index是你这个页面的类名!
不能在Ispostback里面写
像这样public partial class Index : System.Web.UI.Page
如果有 加上
NamespaceName.Index.getClose( "1",setReturn);
你的aspx 页 的 form 有 runat="server" 么?
没有的话 加上
谢谢各位啊 送分啊