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
<PackageReference Include="HBS.LocalizedValidationAttributes.Kentico.MVC" Version="12.29.1" />
paket add HBS.LocalizedValidationAttributes.Kentico.MVC --version 12.29.1
#r "nuget: HBS.LocalizedValidationAttributes.Kentico.MVC, 12.29.1"
// 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
- 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 | Versions 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. |
-
- AngleSharp (>= 0.9.9.2)
- Antlr (>= 3.5.0.2)
- Kentico.AspNet.Mvc (>= 12.0.29)
- Microsoft.CSharp (>= 4.4.1)
- Microsoft.Owin.Security (>= 3.1.0)
- Microsoft.Owin.Security.Cookies (>= 3.1.0)
- Microsoft.Owin.Security.OAuth (>= 3.1.0)
- Microsoft.Web.Xdt (>= 2.1.1)
- Newtonsoft.Json (>= 11.0.2)
- System.ComponentModel.Annotations (>= 4.7.0)
- WebGrease (>= 1.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Adding missing UrlAttribute and added IClientValidation logic, thought it would inherit from base class.