O'Reilly logo

Secrets of Real World ASP.NET Dynamic Data Web Sites by Craig Shoemaker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.4. Validating against Custom Business Logic

Often developers must validate data against a set of domain-specific business rules. Dynamic Data includes a mechanism that enables you easily to bubble up validation errors encountered while attempting to persist data.

The Microsoft .NET 3.5 Service Pack 1 includes a new exception type named the ValidationException from the System.ComponentModel.DataAnnotations namespace. Dynamic Data pages are set up to listen for instances of the ValidationException being passed up the stack. The pages will intercept these exceptions and display the error messages in validation controls placed on data entry pages.

In order to have a place to check the incoming data and have an opportunity to throw a ValidationException ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required