阅读背景:

jQuery ajax调用asp.cs文件里的方法

来源:互联网 

1.首先在 aspx.cs文件里建一个公开的静态方法,然后加上WebMethod属性(要引入System.Web.Services)。 cs页面: [WebMethod]//如果要在这个方法里操作Session,需要将WebMethod的EnableSession属性设为true.即 [WebMethod(EnableSession=true)]或[WebMethod(true)] public static string SayHello() { return "hello"; }1.首先在 aspx.cs文件里建一个公开的静态方法,然后加上WebMethod属性(要引入S




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: