I have the following model:
public class Product { [HiddenInput(DisplayValue = false)] public int ProductID { get; set; } [Required(ErrorMessage
If you use scaffolding the generator will set the input tag with the type hidden in your view. This depends on the T4 Template.
If you create the view manually you must set the field manually. e.g
@Html.HiddenFor(model => model.Id)