var stringArray = new Array();
// or var stringArray=[];
stringArray.push('1');
stringArray.push('2');
var data = JSON.stringify({
'AllRecord': stringArray
});
$.ajax({
url: 'url',
cache: false,
traditional: true,
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: data,
dataType: "json",
success: function (data) {
// Code to be on success of this call
}
})
//In controller grab it like below
public ActionResult SaveCompanyAndSendMailToAllUsers(List<String> AllAgents)
{
// your logic
}
// or var stringArray=[];
stringArray.push('1');
stringArray.push('2');
var data = JSON.stringify({
'AllRecord': stringArray
});
$.ajax({
url: 'url',
cache: false,
traditional: true,
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: data,
dataType: "json",
success: function (data) {
// Code to be on success of this call
}
})
//In controller grab it like below
public ActionResult SaveCompanyAndSendMailToAllUsers(List<String> AllAgents)
{
// your logic
}
No comments:
Post a Comment