WebMethod is used to access web service method - ASP.NET Introduction
Q. If you want to access a web service method, which attribute it must have?- Published on 19 Oct 15a. [WebMethod]
b. [PageMetod]
c. [Web.Service]
d. [WebSupport]
ANSWER: [WebMethod]
A web service is a web-based functionality that is used by other web application.
WebMethod attribute is used with methods within an XML Web service. This attribute makes the method callable from remote Web clients.
Example:
[WebMethod()]
public int Add(int a, int b)
{
return (a + b);
}