In my page I have a datatable. What I want is to change the data on table by from options on tree menu which are links. Basically, each item on tree menu will trigger the Stored Procedure with different parameters.
So far I tried to send the parameter like
<a href="@Url.Action("InboxListByType", "Folder", new { DocumentTypeId = 3 })">e-TCGB</a>
But it is not working. I'm stuck so bad.
This is the ActionResult
public ActionResult InboxListByType(FormCollection coll, int DocumentTypeId)
{
ClaimsIdentity identity = (ClaimsIdentity)User.Identity;
int CompanyId = Convert.ToInt32(identity.FindFirst("CompanyId").Value);
int Draw = Convert.ToInt32(coll["draw"]);
int RowStart = Convert.ToInt32(coll["start"]);
int RowCount = Convert.ToInt32(coll["length"]);
int TotalRows = 0;
DataSet ds = DocumentDB.Document_List_Inbox(CompanyId, RowStart, RowCount, DocumentTypeId, out TotalRows);
string DatatableJson = Utility.DatatableToJson(ds.Tables[0]);
return Content("{ \"draw\": " + Draw + ", \"recordsTotal\" :" + TotalRows + " , \"recordsFiltered\": " + TotalRows + ", \"data\": " + DatatableJson + " } ");
}
One of the problems is FormCollection coll
element is coming in as null
.
Can anyone help?