Hi,
using asp.net mvc2, Data Annotations, MicrosoftAjax.js,MicrosoftMvcValidation.js, jquery for ajax
I have contact form and i am using Data Annotations for the ContactFormModel
.
I add this line <% Html.EnableClientValidation(); %>
to top of the form.
When i click the submit button client validation works perfectly. Now i have changed my mind and want to post the form with jQuery.Ajax.
This time i want to accomplish this.
- Click submit button.
- MicrosoftMVCValidation does the client validation and renders the errors on the clientside.
- If Model is valid i meant if the validation passed i want my jQuery ajax to get involved.
But when i clicked the submit button both ajax post and mvc client validation works. How can i get the things in right order.
1.Mvc Client validation
2. Then jQuery.Ajax Post.