8000 GitHub - shapemetrics/VinValidationAttribute: MVC Vehicle Identification Number Validator
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

shapemetrics/VinValidationAttribute

Repository files navigation

VinValidationAttribute

Vehicle Identification Number Validator for .net core models as an attribute. It is a simple algorithm designed to validate the check digit within a VIN. This only validates the format and the check digit, it does not check the World Manufacturer Identifier (WMI), plant, Vehicle Description Section, year or any other portion of the VIN. T

using System;
using shapemetrics.VinValidation;

namespace shapemetrics.models
{
	public class VehicleViewModel
	{
		[VinValidation]
		public string VIN{get;set;}

	}
}

Validate the postback

within your controller method for postback, check to see if the model is valid.

if(!ModelState.IsValid){
	return View(model);
}

To include unobtrustive client side validation methods.

<script src="/js/VinValidation.js"></script>

About

MVC Vehicle Identification Number Validator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0