在 ASP.NET MVC 中,我编写了下面的代码来给文本框一个初始值:
@Html.TextBoxFor(p => p.WEIGHT, new { tabindex = "140",
@class = "mustInputText noime w50",
maxlength = "8", @Value = "0",
rule = "InputOnlyNum" })
而Html源码如下:
<input Value="0" class="mustInputText noime w50" id="WEIGHT" maxlength="8"
name="WEIGHT" rule="InputOnlyNum" tabindex="140" type="text" value="" />
我注意到“输入”标签中有两个值属性:
Value="0"
和 value=""
如何让它只显示一个值属性?