I want to send list array in ExportTo Method, but in ExportTo method student parameter get null value. If I use ajax it will work fine. But have to use window.locatoin for pass list array.
View
$(document).ready(function () {
$("#SaveBtn").click(function () {
var student = {
Name: "Tanzid",
Department: "CSE"
};
var student1 = {
Name: "Yasir",
Department: "BBA"
};
var list = [];
list.push(student);
list.push(student1);
var url = '@Url.Action("ExportTo", "Students")';
var a = JSON.stringify(list);
window.location = url + '?' + a;
});
})
.
Controller
Public void ExportTo(List<Student> student)
{
}