Thursday , February 21 2019
Home / Dot Net / How to Use Remote Validation in MVC

How to Use Remote Validation in MVC

Remote Validation Attribute allows us to validate properties values with server callback using AJAX. Remote Validation Attribute is available in System.Web.MVC.
Let an Example User wants to fill details in Registration Page . It contains Fields like UserId, Password, EmailId, Qualification, Mobile Number, Mean while to check whether UserId is already used or not with out submitting complete form data.Using Remote Validation Attribute we can solve this scenario.

Note: this feature is available on or after releases of MVC-4 version.

Please follow bellow steps:

  1. Add System.Web.Mvc namespace to Model.
  2. Add Remote Validation Attribute to Model Property.
  3. Check whether these files are existed in your scripts folder (jquery.validate.min.js  &  jquery.validate.unobtrusive.min.js ) if not download it from nuget package manager.
  4. Import these JS files into Layout page or else View Page.
  5. Let Create JSONResult Action to perform validation.

When ever focus out from control automatically it invokes specified action.



Remote Validation in MVC


Remote Validation in MVC


Remote Validation in MVC



Print Friendly, PDF & Email

Give us your valuable feedback


About balamurali devara

Check Also

Studyclues_C#_Date Format

Date Formatting in C#

Date Formats in C#: Date Formatting in C# is a date and time format string …