GenesysStack.com
RSS

Blog posts tagged with 'html'

Did You Know that you can clear MVC TextboxFor default values?
If you like strongly-typed Views...the trick is the Value Html attribute. Not “value”, “Value”. For example: @Html.TextBoxFor(m => m.BirthDate, "{0:MM/dd/yyyy}", new { @id = "txtBirthDate", @class = "form-control BirthDate", @Value = Model.BirthDate == "01/01/1900" ? "" : Model.BirthDate.ToString(), @placeholder = "MM/DD/YYYY" })