I can't seem to get client side validation working with the version of MVC released with Visual Studio 2010 RC.
I've tried it with two projects -- one upgrade from 1.0, and one using the template that came with VS.
I'd think the template version would work, but it doesn't. Added the following scripts:
<script type="text/javascript"
src="<%= Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>">
</script>
<script type="text/javascript"
src="<%= Url.Content("~/Scripts/jquery.validate.js")%>">
</script>
which are downloaded to the client correctly. Added the following to my form page:
<% Html.EnableClientValidation(); %>
<%--yes, am aware of the EndForm() bug! --%>
<% using (Html.BeginForm()) { %>
<%--snip --%>
and I can see the client validation scripts have been added to the bottom of the form. But still client validation never happens.
What is worse is that in my upgraded project, the client validation scripts are never output in the page!
PLEASE NOTE: I am specifically asking about the version of MVC2 that came with VS2010 RC. Also, I do know how to google; please don't waste anybody's time searching and answering if you aren't familiar with this issue in the release candidate of Visual Studio. Thanks.
Error ID10T: User editing one page and testing another.
However, I can't get client-side validation working on the MVC2 template project. If anybody has an idea how to, say, get it working for the registration page, please answer.