A multiline textbox in html is <textarea>
:
<%= Html.TextArea("Body", null, new { cols = "55", rows = "10" }) %>
or:
<%= Html.TextArea("Body", null, 10, 55, null) %>
or even better:
<%= Html.TextAreaFor(x => x.Body, 10, 55, null) %>
And yet another possibility is to decorate your view model property with the [DataType]
attribute:
[DataType(DataType.MultilineText)]
public string Body { get; set; }
and in your view:
<%= Html.EditorFor(x => x.Body) %>
and set the width and height through CSS.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…