I am returning partial view
public virtual PartialViewResult Create()
{
return PartialView("Create");
}
and loading the view in my page when clicking create button with jquery
function createVendor() {
jQuery.ajax({
type: 'GET',
url: 'Vendor/create',
success: function (result) {
$("#popup").html(result).fadeOut('slow').fadeIn('slow');
}
});
}
in my class I am using DataAnnotations for validation, making reference for js files and add adding
<% Html.EnableClientValidation(); %>
before begin form.
the problem is that when I click save the first time with wrong data the validation not working but it is working the second time I click save.