f we want to send or pass multiple parameters using JSON or JQuery in asp.net we need to declare it like as shown below
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: "SaveAudiVideo.aspx/SaveData",
data: JSON.stringify({title: 'value1' ,songPath: 'value2' }),
dataType: "json",
success: function(data) {
$('lbltxt').text(data.d);
},
error: function(result) {
alert("error");
}
});
|
Here JSON.stringify is used to encode the parameters in JSON format and our webmethod will be like as shown below
http://www.aspdotnet-suresh.com/2012/07/how-to-send-or-pass-multiple-parameters.html