Create JavaScript Array:
var stringArray = new Array(); stringArray .push("1"); stringArray .push("2"); stringArray .push("3");
Ajax Call:
$.ajax({ type: 'POST', url: '/Controller/View', traditional: true, dataType: "json", data: { methodParam: stringArray }, success: function (data) { alert("success"); }, error: function (args) { alert("Error on ajax post"); } })
Controller:
[HttpPost] public ActionResult TutorAvailability(string[] methodParam)
No comments:
Post a Comment