在ASP.NET MVC 2 RC2中打开客户端验证后,即使我第一次加载Edit.aspx页面,验证摘要消息也是可见的.它没有用粗体红色显示,只是纯文本.如果我提交带有错误的表单,则验证摘要消息将变为粗体红色,并在下面显示错误列表.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyApp.viewmodels.PersonEditorviewmodel>" %> <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script> <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> <% Html.EnableClientValidation(); %> <% using (Html.BeginForm()) { %> <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %> <%= Html.EditorForModel() %> <p> <input type="submit" value="Save" /> </p> <% } %>
这是一个错误还是我做错了什么?如果它是一个bug,是否有解决方法?
注意:如果我关闭客户端验证,一切正常.