With client-side validation turned on in ASP.NET MVC 2 RC2, the validation summary message is visible even when I first load my Edit.aspx page. It does not show in bold red, however, just plain text. If I submit the form with an error, then the validation summary message turns bold red, and a list of errors appears below.
Here is the code that contains the validation summary:
<%@ 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>
<%
}
%>
Is this a bug or am I doing something wrong? If it is a bug, is there a workaround?
Note: If I turn off client validation, everything works properly.