I’m trying to use the example from this site to do client site validation. I’m trying to use the html form tag instead of the Html.BeginForm() but doing that disables the client side validation. Does EnableClientValidation only work with Html.BeginForm. What is the difference?
<%@ Page Language="C#" Inherits="ViewPage<ProductViewModel>" %>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) { %>
<%= Html.TextBoxFor(m => m.Title) %>
<%= Html.ValidationMessageFor(m => m.Title) %>
<%= Html.TextBoxFor(m => m.Price) %>
<%= Html.ValidationMessageFor(m => m.Price) %>
<input type="submit" />
<% } %>
From the post you linked (Emphasis added):
The BeginForm method is obviously doing more in ASP.NET MVC 2 than just “rendering out a form tag” – it’s also rendering out all the client script for the validation if that flag is set.