I have a C# asp.net MVC web application, and I'm using System.ComponentModel.DataAnnotations for form validation.
Here is an example of validation on a password field:
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set;
In my View, the form has:
@using (Html.BeginForm() {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
I'm planning to use JQuery to Submit my form/model.
Example:
$.post("@Url.Action("Update")",values,function(data)
{
// do stuff;
});
My question is: will the built-in forms validation still occur, even though I am submitting the data with JQuery?