Click here to Skip to main content
15,884,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here i want to pass three parameters to that webservice using Url ,

then that webservice return some html values to this page
Posted

Use Ajax .. For example
JavaScript
  function WebServiceCallingFunctionName() {
    $.ajax({
        type: "POST",
        url: "PageName.aspx/WebServiceMethodName",
        data: "{param:'param'}",
        contentType: "application/json",
        dataType: "json",
        success: function (msg) {
            Osuccessfunctionlogic(msg.d);
    });
}


[Edit member="Tadit"]
Added correct language to pre tag.
[/Edit]
 
Share this answer
 
v3
You can pass three parameters like that.. :)


JavaScript
function CallWebService() {
    $.ajax({
        type: "POST",
        url: "PageName.aspx/WebServiceMethodName",
        data: "{'Param1':'" + Param1 + "','Param2':'" + Param2 + "','Param3':'" + Param3 + "'}",
        contentType: "application/json",
        dataType: "json",
        success: function (msg) {

        //On Success

        },
        error: function (result) {

            //On Error
        }
    });
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900