Hi Team,
I am using an iggrid and I am unable to pass any data from view to the controller in ajax call . Below is my code
Javascript code
$("#csagrid").igGrid({ columns: [
{ headerText: "Manager", key: "EMPLOYEE_NAME", dataType: "string" }, { headerText: "CSA", key: "CSA_NB", dataType: "string" }, { headerText: "Entry Date", key: "ENTRY_DATE", dataType: "date" }, { headerText: "Project Name", key: "PROJECT_NAME", dataType: "string" }
], defaultColumnWidth: "200px",
width: "100%", showHeaders: true, fixedHeaders: false, type: "POST", caption: "Report", dataSourceType: "json", dataSource: "/Reports/CSAReportData/", data: { year: "0017" } });
Controller code
public JsonResult CSAReportData(string year) { return jsonResult; }
Although I am passing "0017" in year parameter but unable to get it in the controller code . I am getting null in controller .
Create a class containing year: string property and expect object of this type in the controller:
public class DateYear {
public year: string {get; set;}
}
public JsonResult CSAReportData(DateYear date){return jsonResult;}
I have already passed "0017" value in year property in javascript code and its a string type, wanted to get this data in my controller code .