Hi,
I am starting on MVC 2, and I was wondering how the validation summaries work? I thought that it would something similar to the ASP.NET web forms validation summary control. First of all, I am doing simple validation, which of these .js files are required?
<script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>" type="text/javascript"></script>
My current code looks like this:
<%: Html.TextBoxFor(model => model.ApplicationState) %>
<%: Html.ValidationMessageFor(model => model.ApplicationState) %>
I am using my own styles, and I want the text to display in red. Currently it is in black. If I go to view source then the class that is being used is field-validation-valid, there is a field-validation-error style as well. When is this class used? If my errors is displayed then the style that is used is field-validation-valid.
Should I go and create my own style called field-validation-valid or field-validation-error and make the text red?
Thanks.