Asp.Net Mvc Hidden Field from Data Annotations

This property:

[System.Web.Mvc.HiddenInput(DisplayValue = false)]
public int Id { get; set; }

will be rendered as i.e.

<input id="Id" name="Id" type="hidden" value="21" />

when using Html.EditorForModel() or Html.EditorFor(m => m.Id)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)