I enable client validation using the Html.EnableClientValidation
method in my view. This client-side validation works great for text boxes, but I think I might have found a bug when used with dropdownboxes.
If you use the following construction Html.DropDownList( name, data, "Please choose..." )
without any ViewData-item with that name then client-side validation works great. If you look at the generated HTML code you will see that ASP.NET generated ValidationRules for it in the JSON block.
However, if I add a ViewData-item with that name then the ValidationRules for the client validation is empty!
In both cases, server-side validation works as expected. Bug or is there something that I am missing?