Articles : Page 1 of 1

  • Model Metadata and Validation Localization using Conventions

    Model Metadata and Validation Localization using Conventions

    Jul 11
    14

    By default, ASP.NET MVC leverages Data Annotations to provide validation. The approach is easy to get started with and allows the validation applied on the server to “float” to the client without any extra work. However, once you get localization involved, using Data Annotations can really clutter your models. For example, the following is a simple model class with two properties. public class Character { public string FirstName { get; set; } public string LastName { get; set; } } Noth...


  • FluentValidation v3: ASP.NET MVC validation interceptors

    FluentValidation v3: ASP.NET MVC validation interceptors

    Apr 11
    28

    This is part 3 in a series about new features in FluentValidation v3. Part 1 – RuleSets Part 2 – CustomizeValidatorAttribute Part 3 – ASP.NET MVC Validation interceptors Since ASP.NET MVC 2 was released last year, FluentValidation has had the ability to plug into the MVC validation pipeline using a custom ModelValidatorProvider. However, one of [...]...


  • FluentValidation v3: CustomizeValidatorAttribute

    FluentValidation v3: CustomizeValidatorAttribute

    Feb 11
    04

    This is part 2 in a series about new features in FluentValidation v3. Part 1 – RuleSets Part 2 – CustomizeValidatorAttribute FluentValidation supports integration with ASP.NET MVC’s validation infrastructure. This allows you to plug FluentValidation into MVC’s model-binding process so that complex types are validated when they are constructed from form/querystring parameters. However, using this [...]...


  • Globalizing ASP.NET MVC Client Validation

    Globalizing ASP.NET MVC Client Validation

    May 10
    10

    One of my favorite features of ASP.NET MVC 2 is the support for client validation. I’ve covered a bit about validation in the following two posts: ASP.NET MVC 2 Custom Validation covers writing a custom client validator. Localizing ASP.NET MVC Validation covers localizing error messages. However, one topic I haven’t covered is how validation works with globalization. A common example of this is when validating a number, the client validation should understand that users in the US enter...



  • 1