I am trying to call a controller method when the user clicks a button, I also need a variable passed to this method. This is the code I have.
View:
<input type="number" id="nbrMetric" name=metricNbr class="form-control" style="width:75px;" min="0">
@Html.ActionLink("Search", "InputTest", "CustomersController", new { @class = "btn btn-info", @Metric = "nbrMetric" })
Controller:
public ActionResult InputTest(int Metric)
{
//Do Something
return View();
}
Customersinstead ofCustomersController.