html(cshtml) file
function updateNotification() {
var ids = [1, 2, 3, 4, 5];
if (ids.length > 0) {
$.ajax({
traditional: true, // Should be true
type: "POST",
url: "/Notification/Update", // Url to pass
data: { ids: ids },
dataType: "json",
success: function (result) {
},
error: function (result) {
}
});
}
}
Code Behind(cs) file
[HttpPost]
public JsonResult Update(int[] ids)
{
// ids is int array
return Json(new { result = true });
}
No comments:
Post a Comment