How to Validate Forms with ASP.NET MVC 2 Data Annotations: Listing 6.

Registering the Custom Attribute in Global.asax

Sub Application_Start()
        AreaRegistration.RegisterAllAreas()
        RegisterRoutes(RouteTable.Routes)
        DataAnnotationsModelValidatorProvider.RegisterAdapter(
            GetType(WithinDaysAttribute), GetType(WithinDaysValidator))
    End Sub
comments powered by Disqus

Featured

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events