I have a form:
@using (Html.BeginForm("QuoteUpdate", "Home", FormMethod.Post))
{
@Html.DropDownList("network", Model.availableNetworks);
@Html.DropDownList("grade", Model.grades);
@Html.HiddenFor(o => o.Product.id);
<button type="submit">Get Quote</button>
}
And a controller:
[HttpPost]
public ActionResult QuoteUpdate(int? id, string network, string grade )
{
}
The id
property is always null after form is submitted. I have checked source and the hidden field has the correct value in the rendered HTML.
I cannot figure out why this parameter is always null. What am I missing?