Well, I have 2 actions in different controller but the work procedure is almost same however their input parameter are slightly different. One action is receiving some POST
parameter in addition with model where as other action does not. So I would like to call one action from another controller through the different action. Therefore I need to pass the POST
parameters as well. So what do I do?
For example My Main Action is like in ProcedureController
controller
public virtual byte[] GenerateProcedureReports(Report model)
{
procedureListIds = Request.Form["ProcedureMultiCheckList"].Trim();
}
Look here I am receiving procedureListIds
from Form request
So if I redirect any route to this action how do I send this parameter ProcedureMultiCheckList
I have tried this way by studying this Questions 1, 2, 3. However I didn't get any solution regarding to this problem.
I have tried by this way from ProcedureJobsController
public virtual ActionResult JobReport(long id)
{
var jobInformation = _procedureJobService.Get(id);
if (jobInformation.IsFromTablet)
{
Report report = new Report();
return RedirectToAction("GenerateProcedureReports", "Procedures", new {report =report, ProcedureMultiCheckList = jobInformation.ProcedureId });
}
}
Here I have tried to pass model and the POST
parameter(ProcedureMultiCheckList
), but it is not receiving as a Form request
parameter. So, how do I solve this problem?
If this can be done I will be able to reduce thousands line of code. Pretty pathetic, Huh?