【发布时间】:2011-05-07 05:37:10
【问题描述】:
我正在开发一个 asp.net mvc 2 应用程序并使用 Html.TextAreaFor 来显示一个文本区域,用户可以在其中输入文本,然后在需要时存储和发送。
显示此功能的视图是强类型的(typeof(Message))。消息具有发送者、接收者、主题和消息正文。视图中的代码如下所示
<% using (Html.BeginForm())
{%>
<%: Html.ValidationSummary(true) %>
<fieldset style="height:100%">
<legend>E-mail</legend>
<div class="editor-label">
<%: Html.LabelFor(model => model.To) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.To) %>
<%: Html.ValidationMessageFor(model => model.To) %>
</div>
<div class="editor-label">
<%: Html.LabelFor(model => model.From) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.From) %>
<%: Html.ValidationMessageFor(model => model.From) %>
</div>
<div class="editor-label">
<%: Html.LabelFor(model => model.Subject) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Subject) %>
<%: Html.ValidationMessageFor(model => model.Subject) %>
</div>
<div class="editor-label">
<%: Html.LabelFor(model => model.Message) %>
</div>
<div class="editor-field">
<%: Html.TextAreaFor(model => model.Message) %>
<%: Html.ValidationMessageFor(model => model.Message) %>
</div>
<p>
<input type="submit" value="SaveMail" />
</p>
</fieldset>
<% } %>
当我在浏览器中打开此页面时,提交按钮被放置在 textarea 上,我无法让它正确呈现...有人帮忙吗?
【问题讨论】:
-
对我来说这听起来更像是 html/css 问题。你有这个页面的链接吗?
标签: asp.net asp.net-mvc-2 rendering textarea