Đây là mã của tôi:ASP.NET MVC: Html.EditorFor và nhiều dòng hộp văn bản
<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>
Đây là những gì nó tạo ra:
<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>
Làm thế nào để nói với nó rằng lĩnh vực này nên là một hộp văn bản với năm dòng thay vì chỉ một hộp văn bản một dòng?
bản sao có thể có của [ASP.NET MVC3 - textarea với @ Html.EditorFor] (http://stackoverflow.com/questions/4927003/asp-net-mvc3-textarea-with-html-editorfor) –