Skip to content

geeksarray/how-to-do-custom-validation-using-validationattribute-of-aspnet-mvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

How to do custom Validation using Validationattribute of ASP.NET MVC

ValidationAttribute class is included in DataAnnotations namespace. It helps you to validate model data received from user. It gives you many in built validation attributes like StringLength, Required, DataType for validating model.

Files

  1. Customer Details View - html view having Customer details.
  2. Model Class with Custom Validation - has implemented ValidationAttribute class to achieve custom validation of Join Date of Customer.
  3. Customer Model - with custom validation attribute used for JoinDate property.

Below picture show implementation of Custom Validation attribute

Custom Validation attribute in ASP.NET MVC

For more details visit - Custom Validation Attribute in ASP.NET MVC

About

ValidationAttribute class is included in DataAnnotations namespace. It helps you to validate model data received from user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published