Hello Sir,
I am trying to pass model data from view to controller but it's not working. Infact it's not firing the action in controller.
Please help and guide me.
Thanks
My Code like this:
#MODEL
public class model{
report objReport = new report();
model = new model()
{
objReport = new report();
}
}
public class reoprt{
public int reportID {get;set;}
}
#CONTROLLER
public string save(model objModel)
{
return "done";
}
#AJAX CALL
var objDailyReport = $("#CNform").serialize();
$.ajax({
type: "POST",
url: "/dailyreportingregister/Save",
data: objDailyReport,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert("done");
}
});
$.ajax({
type: "POST",
url: "/dailyreportingregister/Save",
data: objDailyReport,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert("done");
}
});

Laxmidhar SahooRank #383 · 6.6K reputationPosted Nov 15, 2018, 11:22 PM EST
Brian Lee46 reputationPosted Nov 15, 2018, 9:03 PM EST
Thiyagarajan ERank #2,329 · 607 reputationPosted Nov 15, 2018, 8:34 PM EST