C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,815 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
First, I create a default Web Service(ASMX).And It has a default webMethod.just like:
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
Next,I want to add this method to my objects's references, but it show some errors:
and the detail is
I don't konw why.
Please help me.
I finde the reason.
Because I webMethod in App_Code Files,So it can't be called.
if I move it to another place, it work success!