1.3. Building Custom Field Templates

The field templates included in the default Dynamic Data template attempt to match UI functionality by data type. Custom field templates take the idea of representing data one step further and give you an opportunity to provide domain-specific behavior to each field.

Centralizing the UI elements for a single data member can yield many benefits. Instead of having to add validation controls on each and every page where user input is required, field templates can house the validators and use some simple logic to decide whether to enable validation constraints. Encapsulating the UI into field templates begins to give your ASP.NET application reusable building blocks to make creating and maintaining data-driven ...

Get Secrets of Real World ASP.NET Dynamic Data Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.