When calling a asmx service via jqeury, how to pass arguments?

Posted by Blankman on Stack Overflow See other posts from Stack Overflow or by Blankman
Published on 2010-05-10T20:46:40Z Indexed on 2010/05/10 20:54 UTC
Read the original article Hit count: 289

Filed under:
|
|
|

How can I pass my service endpoint parameters? (pagesize in this case)

My .asmx service method looks like:

 [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public List<Object> GetData(int pageSize)
    {

    }

When I call this via jQuery like:

$.ajax({
        type: "POST",
        url: "test.asmx/test123",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(msg) {

        },
        error: function(msg) {

        }
    });

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#