C# 将参数从Ajax JQuery跟踪到[WebMethod]
在C# 将参数从Ajax JQuery跟踪到[WebMethod],c#,asp.net,webforms,C#,Asp.net,Webforms,在Webmethod [WebMethod] public static List<UserModel> GetUsers() [WebMethod] 公共静态列表GetUsers() 如果我们不知道客户端,如何知道参数的名称和类型。 例如:如果我知道名称和类型,我可以获取页面,然后我有如下方法: [WebMethod] public static List<UserModel> GetUsers(int page) [WebMethod] 公共静态列表GetUse
Webmethod
[WebMethod]
public static List<UserModel> GetUsers()
[WebMethod]
公共静态列表GetUsers()
如果我们不知道客户端,如何知道参数的名称和类型。
例如:如果我知道名称和类型,我可以获取页面,然后我有如下方法:
[WebMethod]
public static List<UserModel> GetUsers(int page)
[WebMethod]
公共静态列表GetUsers(int页)
我搜索后发现:
然而,PostSharp并不像我期望的那样。您在这里的意思是什么,您根本不了解客户端?您可以在web服务内部使用
HttpContext.Current
。