如果你google了还没有解决 那么看看 aspx这里是否为这个:
web.config:
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
</httpHandlers>
aspx.cs
namespace TunnelSystem
{
public partial class quanzhong : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//注册ajaxPro,括号中的参数是当前的类名
AjaxPro.Utility.RegisterTypeForAjax(typeof(quanzhong));
}
[AjaxPro.AjaxMethod]
public int savaToText(string big, string small)
{
return 1;
}
}
}
aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="quanzhong.aspx.cs" Inherits="TunnelSystem.quanzhong" %>
js
var a=TunnelSystem.quanzhong.savaToText(big+'',small+'').value;
之前的思路是
var a=quanzhong.savaToText(big+'',small+'').value;
加上明明空间就好了