C# MVC4 ActionResult ActionFilter for FormCollection-Collection of common programming errors
I have the following ActionResults and one is meant to be an override of the other that accepts a FormCollection as a parameter.
[HttpPost]
public ActionResult PartialAverageDisplay()
{
HomeModel C = new HomeModel();
ChViewModel D = new ChViewModel();
D = C.AverageCalculation();
return PartialView(D);
}
[HttpPost]
public ActionResult PartialAverageDisplay(FormCollection myFcollection)
{
HomeModel C = new HomeModel();
System.Data.DataTable myDT = new System.Data.DataTable();
myDT = (DataTable)Session["DT"];
ChViewModel D = new ChViewModel();
D = C.AverageCalculation(myDT, myFcollection);
return PartialView(D);
}
I’ve been unable to find an example online of how to create an actionfilter attribute for requiring a FormCollection. Everything Ive seen has used an array of strings. Im not experienced with creating actionfilters. Can anyone explain to me how to approach this?
Thanks