Hi,
I have loaded a prtial view in my MVC 2 application. The partial view is loaded via the jquery get method. The partial view contains the following code below. The problem I am having is that when the submit button is clicked the xval validation message appears but the form still gets posted. Has anyone any ideas how to stop the form posting if there is a validation error?
<% using (Ajax.BeginForm("InsertOrUpdate", "Division", new AjaxOptions { UpdateTargetId = "grid", OnComplete = "closemodal" })) {%> <%: Html.ValidationSummary(true) %> <%: Html.LabelFor(model=> model.DivisionName) %> <%: Html.EditorFor(model=> model.DivisionName) %> <%: Html.HiddenFor(model => model.DivisionKey)%> <%= Html.ClientSideValidation("model")%>
<% } %> <%= Html.ClientSideValidation() %>