I want to pass two string arrays from the view to controller using Ajax.But while passing it shows the error jquery-latest.min.js:4 POST http://localhost:5342/Purchase/ClearCart 500 (Internal Server Error) The Method is not passing to the controller.Tried with a break point.Here is how am passing string[]
var items = $('.mids').map(function () {
return $(this).val()
}).get();
var counts = $('.counts').map(function () {
return $(this).val()
}).get();
if (BOLT.response.txnStatus == 'SUCCESS') {
alert("success");
$.ajax({
url: "/Purchase/ClearCart",
type: "POST",
contentType: "application/json",
//dataType: "text",
data: { mid: items, count: counts },
success: function (result) {
alert("success");
},
error: function (e) {
alert("Failed");
}
});
It returns "Failed" response and the above error.
Controller
[HttpPost]
public void ClearCart(string[] mid,string[] count)
{
int uid=Convert.ToInt32(Session["uid"]);
userService.ClearCart(uid, mid,count);
}

data: { mid: items, count: counts }? We need to see that so we could make a model for it.contentType: "application/json",