我正在使用 MVC3。我有一个运行良好的基本项目,并将默认 MVC 验证显示为红色。
现在验证虽然仍然有效,但显示为黑色而不是红色。除此之外一切都很好。
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")
@using (Html.BeginForm("Logon", "Research",
new { returnUrl = Request.QueryString["ReturnUrl"] }, FormMethod.Post,
new { @class = "form"}))
{
<div style="margin-top:20px">
@Html.LabelFor(m => m.UserName)
<div class="input">
@Html.TextBoxFor(m => m.UserName)
</div>
<div class="input">
@Html.ValidationMessageFor(m => m.UserName)
</div>
</div>
<div>
@Html.LabelFor(m => m.Password)
<div class="input">
@Html.PasswordFor(m => m.Password)
</div>
<div class="input">
@Html.ValidationMessageFor(m => m.Password)
</div>
</div>
<div class="actions" style="margin-bottom:20px">
<input type="submit" value="Log On" class="button" />
</div>
}