我用的是 [WebMethod] ,就想问问这是不是他们所谓的WebService?
I use [WebMethod] , just want to ask if this is what they call WebService?
在我后面的 C# 代码中,我有一个像这样的 WebMethod
//Get total Sales monthly
[WebMethod]
public static List<object> getTotalSales(){
//lines of codes;
}
我的问题是,我是在做网络服务吗?我在前端(aspx 页面)使用了返回值,这是由我在 aspx 文件中的 jQuery ajax 函数调用的。
Web 服务是 WebService
对象或可通过 WebMethod
s 访问的 ASMX 文件。
您可以通过创建 .asmx
页面自行创建网络服务。
您在这里所做的是将页面中的 public 方法转换为网络服务。
所以对你的问题的简短回答是,是的,你正在做一个叫做网络服务的事情。然后您可以通过 ajax.
在您的客户端中调用它
在我后面的 C# 代码中,我有一个像这样的 WebMethod
//Get total Sales monthly
[WebMethod]
public static List<object> getTotalSales(){
//lines of codes;
}
我的问题是,我是在做网络服务吗?我在前端(aspx 页面)使用了返回值,这是由我在 aspx 文件中的 jQuery ajax 函数调用的。
Web 服务是 WebService
对象或可通过 WebMethod
s 访问的 ASMX 文件。
您可以通过创建 .asmx
页面自行创建网络服务。
您在这里所做的是将页面中的 public 方法转换为网络服务。
所以对你的问题的简短回答是,是的,你正在做一个叫做网络服务的事情。然后您可以通过 ajax.
在您的客户端中调用它