Created
February 12, 2013 12:24
-
-
Save einarwh/4761986 to your computer and use it in GitHub Desktop.
The ASP.NET MVC djinns must be informed to use your custom validator class when doing validation using your custom validation attribute.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
// ... code omitted ... | |
DataAnnotationsModelValidatorProvider.RegisterAdapter( | |
typeof(MkayAttribute), | |
typeof(MkayValidator)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment