Articles : Page 1 of 1

  • 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...


  • ASP.NET MVC 2 Optional URL Parameters

    ASP.NET MVC 2 Optional URL Parameters

    Feb 10
    12

    If you have a model object with a property named Id, you may have run into an issue where your model state is invalid when binding to that model even though you don’t have an “Id” field in your form. The following scenario should clear up what I mean. Suppose you have the following simple model with two properties. public class Product { public int Id { get; set; } public string Name { get; set; } } And you are creating a view to create a new Product. In such a view, you obviously don’...

    • Routing
    • validation
    • MVC2


  • 1