I have this page method (web method):
public partial class MyTest : System.Web.UI.Page
{
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
public static string Greeting()
{
return "Hi!";
}
}
Is it possible to type MyTest.aspx/Greeting
in the browser and get the actual string? It works via Ajax (method GET) but doesn't seem to work directly from browser (the .aspx page is returned instead).
I know about MVC / Web Api, but I cannot use them.
Related questions:
Possible to invoke ASMX service with parameter via url query string?