【发布时间】:2013-05-25 22:39:57
【问题描述】:
我正在开发 MVC 应用程序。带靴带。
我正在尝试为名字字段设置边距。
请检查下图。
现在的问题是验证消息没有正确显示。 我想在名字下方显示验证消息。 如果我使用的边距超过 20 像素,则文本框位于名字标签下方。
如何做到这一点?
下面是代码。
<div class="span6">
<div class="editor-label span3">
@Html.LabelFor(model => model.FirstName, "First Name")
</div>
<div class="editor-field span6 InputBoxMargin" style="width:290px; margin-right:20px;">
@Html.TextBox("FirstName",null, new {style = "width:210px;" })
@Html.ValidationMessageFor(model => model.FirstName,"You can't leave this empty.")
</div>
</div>
【问题讨论】:
-
@Html.ValidationMessageFor(model => model.FirstName,"
你不能留空。") -
谢谢,但我不想使用
标签: asp.net-mvc-3 twitter-bootstrap