How to access WebMethods in ASP.NET
- by Quandary
When i define an AJAX WebMethod like this in an ASPX page (ui.aspx):
[System.Web.Services.WebMethod(Description = "Get Import Progress-Report")]
[System.Web.Script.Services.ScriptMethod(UseHttpGet = false, ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
public static string GetProgress()
{
System.Web.Script.Serialization.JavaScriptSerializer JSONserializer = new System.Web.Script.Serialization.JavaScriptSerializer();
return JSONserializer.Serialize("an Object/Instance here");
} // End WebMethod-Function GetProgress
Can I access the description for the corresponding service somewhere ?
E.g. when I want to call the webmethod with my own JavaScript, how do I do that ?
I investigated the axd files, and found the xmlhttprequest to open ui.aspx/GetProgress
But when I type the address in my browser, I get redirected to ui.aspx