【发布时间】:2012-12-09 00:35:06
【问题描述】:
我使用 Razor 创建了一个文本框,并尝试如下设置 value。
@Html.TextBoxFor(model => model.Destination, new { id = "txtPlace", value= "3" })
我已经尝试将value 附加到@
@Html.TextBoxFor(model=> model.Destination, new { id = "txtPlace", @value= "3" })
即使它使用空的value 呈现html input 标记
<input id="txtPlace" name="Destination" type="text" value
class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset ui-mini" >
做错了什么?
【问题讨论】:
标签: .net asp.net-mvc asp.net-mvc-3 razor html.textboxfor