Ad

What's The Best Way To Implement Field Validation Using ASP.NET MVC?

- 1 answer

I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET MVC.

Ad

Answer

Take a look at the JQuery Validation plugin this plugin is amazing,it's clean to implement and has all the features you could ever need, including remote validation via AJAX.

Also a sample MVC controller method can be found here which basically uses the JsonResult action type like:

public JsonResult CheckUserName(string username)
{
    return Json(CheckValidUsername(username));
}
Ad
source: stackoverflow.com
Ad