【发布时间】:2011-09-27 00:50:06
【问题描述】:
这是我的代码:
<div class="editor-label">
@Html.LabelFor(model => model.Comments[0].Comment)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Comments[0].Comment)
@Html.ValidationMessageFor(model => model.Comments[0].Comment)
</div>
这是它生成的:
<div class="editor-label">
<label for="Comments_0__Comment">Comment</label>
</div>
<div class="editor-field">
<input class="text-box single-line" data-val="true" data-val-required="The Comment field is required." id="Comments_0__Comment" name="Comments[0].Comment" type="text" value="" />
<span class="field-validation-valid" data-valmsg-for="Comments[0].Comment" data-valmsg-replace="true"></span>
</div>
如何告诉它该字段应该是一个五行文本框,而不是一个单行文本框?
【问题讨论】:
标签: asp.net-mvc-3 razor