Reputation: 11926
How do I access the following written in View
@Html.HiddenFor(Model=>Model.id)
in Controller ?
Thank you
Upvotes: 1
Views: 1292
Reputation: 32447
Create a Action method that takes the Type that you used as Model in your view.
[HttpPost]
public ActionResult Create(MyModel model)
{
var id = model.id;//the id in @Html.HiddenFor(Model=>Model.id)
}
Upvotes: 2