Passing Custom Parameters
Passing Custom Parameters
CMOFNL
Posts: 14Questions: 3Answers: 0
Hi, I need to pass additional parameters from my view to the controller (asp.net mvc5) within the datatables ajax call. In the read-only version of datatables I do this with the data part as follows :
"data": function (data) {
data.StartDate = $('#reportStartDate').val();
data.EndDate = $('#reportEndDate').val();
data.DeviceId = $('#selectedDeviceId').val();
data.__RequestVerificationToken = $('input[name=__RequestVerificationToken]').val();
}
I could then access these values from Request.Form in the controller method
However in the Editor version this does not seem to work, i.e. the values are not available in Request.Form
Can someone please help me out with the correct way to do this in the Editor version ? Thanks.
Answers
OK I found my mistake, I had these parameters in the Editor ajax call but no the table ajax call. Schoolboy error.