I have the following problem:
I make the call to the method of a controller, it receives a parameter.
The code is as follows:
@Html.ActionLink("Preview", "ReportExecution", "Report", new { reportName = ViewBag.docLiquidation }, null)
This generates me the following address:
http://localhost:65500/Report/ReportExecution/docRetentionDeclaration
docRetentionDeclaration identified as a parameter, but does not.
The code of the method is as follows:
[HttpPost]
public FileResult ReportExecution(string reportName)
{
.
.
return new File();
}
I appreciate the help you can give me.
Assuming you have the following route:
the controller action will expect the parameter to be called reportName:
Notice how the parameter name of the controller action must match the route token in your route definition.