In ASP.MVC 3, how do I specify the columns and rows for a multiline EditorFor
(textarea)? I am using [UIHint("MultilineText")]
, but can't find any documentation on how to add attributes for the text area.
Desired HTML:
<textarea cols="40" rows="10"></textarea>
Relevant Part of my MVC 3 Model:
[UIHint("MultilineText")]
public string Description { get; set; }
Relevant Part of my Razor cshtml:
<div class="editor-field">
@Html.EditorFor(model => model.Description)
</div>
What I'm getting in View Source:
<div class="editor-field">
<textarea class="text-box multi-line" id="Description" name="Description"></textarea>
</div>
How do I set rows and columns?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…