How to set a default value with Html.TextBoxFor?
Try this:
<%= Html.TextBoxFor(x => x.Age, new { @Value = "0"}) %>
note that @Value
has a capital V
This should work for MVC3 & MVC4
@Html.TextBoxFor(m => m.Age, new { @Value = "12" })
If you want it to be a hidden field
@Html.TextBoxFor(m => m.Age, new { @Value = "12",@type="hidden" })