【发布时间】:2015-05-07 18:02:45
【问题描述】:
我正在学习 MVC,并且正在通过第一个代码制作联系表格。 谁能解释一下为什么消息区域小于标题编辑器以及为什么它丢失了引导 css?
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<div class="form-group">
@Html.LabelFor(model => model.title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.title, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.message, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.message, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.message, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="wyslij" class="btn btn-default" />
</div>
</div>
</div>
}
【问题讨论】:
-
你能做个小提琴吗
-
您为什么使用编辑器模板而不是文本框作为标题?
-
它是脚手架自动生成的,我只是尝试将带有消息的部分更改为文本区域不是编辑器
-
你能解决你的问题吗,如果有帮助请查看我的回答。
标签: html css asp.net-mvc twitter-bootstrap razor