razor - ASP.NET MVC: Html.EditorFor and multi-line text boxes -
this code:
<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>
this generates:
<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 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>
how tell field should text box 5 lines instead of single-line text box?
use data type 'multilinetext':
[datatype(datatype.multilinetext)] public string text { get; set; }
Comments
Post a Comment