HBS.LocalizedValidationAttributes.Kentico.MVC 12.29.1

dotnet add package HBS.LocalizedValidationAttributes.Kentico.MVC --version 12.29.1
NuGet\Install-Package HBS.LocalizedValidationAttributes.Kentico.MVC -Version 12.29.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HBS.LocalizedValidationAttributes.Kentico.MVC" Version="12.29.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HBS.LocalizedValidationAttributes.Kentico.MVC --version 12.29.1
#r "nuget: HBS.LocalizedValidationAttributes.Kentico.MVC, 12.29.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HBS.LocalizedValidationAttributes.Kentico.MVC as a Cake Addin
#addin nuget:?package=HBS.LocalizedValidationAttributes.Kentico.MVC&version=12.29.1

// Install HBS.LocalizedValidationAttributes.Kentico.MVC as a Cake Tool
#tool nuget:?package=HBS.LocalizedValidationAttributes.Kentico.MVC&version=12.29.1

Kentico Localized Validation Attributes

This set of Validation Attributes extend the default DataAnnotations Attributes, allowing you to have Error Messages that contain Kentico Localized String Macros (ex "{$ customvalidation.message $}")

There are also a handful of Validation Attributes that are not in the assembly due to dependencies on Interfaces that you may wish to implement yourslef, these are in the Other Helpful Validation Attributes

Installation

  1. Install the HBS.LocalizedValidationAttributes.Kentico.MVC NuGet Package to your MVC Site

Usage

Where you would put your normal ValidationAttribute, just add "Localized" before it.

Example: [Required(ErrorMessage = "I wish i was localized")] [LocalizedRequired(ErrorMessage = "{$ custom.requirederror $}"]

You can also inherit LocalizedValidationAttribute instead of ValidationAttribute for your own custom validations. This will, by default, localize the error message, but you may need to still overwrite the FormatErrorMessage if you need to add additional properties to the formatted message.

Example of an inherited ValidationAttribute can be found here.

Example of an inherited ValidationAttribute with an overwritten FormatErrorMessage can be found here.

Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
12.29.1 2,719 5/14/2020
12.29.0 491 5/14/2020

Adding missing UrlAttribute and added IClientValidation logic, thought it would inherit from base class.