How to set a default value with Html.TextBoxFor?

后端 未结 12 2249
清歌不尽
清歌不尽 2020-12-04 07:24

Simple question, if you use the Html Helper from ASP.NET MVC Framework 1 it is easy to set a default value on a textbox because there is an overload Html.TextBox(strin

12条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 07:39

    Try this also, that is remove new { } and replace it with string.

    <%: Html.TextBoxFor(x => x.Age,"0") %>
    

提交回复
热议问题