How to access WebMethods in ASP.NET

Posted by Quandary on Stack Overflow See other posts from Stack Overflow or by Quandary
Published on 2010-03-30T09:37:05Z Indexed on 2010/03/30 9:43 UTC
Read the original article Hit count: 579

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

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about AJAX