Skip to content

Instantly share code, notes, and snippets.

@einarwh
Created February 12, 2013 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einarwh/4761986 to your computer and use it in GitHub Desktop.
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.
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