I am trying to pass list of int type to Controller on jquery load, but not successfull. Here is my code:
function Addcov() {
var dt = '@ViewBag.dt';
@{
List<int> covtypes = new List<int>();
foreach (var item in ViewBag.CovTypes)
{
covtypes.Add(item);
}
}
alert('@covtypes');
$("#Form").dialog({
autoOpen: true,
width: 1000,
resizable: false,
title: 'Add',
modal: true,
open: function () {
$(this).load(
'../controller/AddAction',
{ fromDate: dt, CovTypes: JSON.stringify('@covtypes') },
function (response, status, xhr) {});
},
buttons: {}
});
}
I might see your problem, the path. debug and make sure that the path you are passing is correct and that the data actually being passed through the covtypes.
The main issue that I see here, is the path, which is not passed correctly. Try with the full path and see what happens.