【发布时间】:2013-01-11 12:17:35
【问题描述】:
使用:ASP .NET MVC 4 在我的一个页面中,我需要一个具有一定宽度和高度的 textarea,使用 html helper class。我的一些代码如下:
<div class="editor-label">
@Html.LabelFor(model => model.MailSubject)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.MailSubject)
@Html.ValidationMessageFor(model => model.MailSubject)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.MailBody)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.MailBody)
@Html.ValidationMessageFor(model => model.MailBody)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Content)
</div>
<div class="editor-field1">
@Html.EditorFor(model => model.Content)
@Html.ValidationMessageFor(model => model.Content)
</div>
我想知道如何定义 editorfor(model.content) 的大小(宽度/隐藏)?
【问题讨论】:
-
您需要设置编辑器的高度吗?还是你需要使用 textarea 并设置它的高度和宽度?
-
@AliRızaAdıyahşi,谢谢。定义 col/rows 可以响应吗?
标签: asp.net-mvc-4 textarea html-helper