Databases Reference
In-Depth Information
CHAPTER 4
IN THIS CHAPTER
. Creating an Entity Template
Entity Templates
. Composite Entity Templates
. Generic Entity Templates
. Dynamic Entity Templates
. Edit and Insert Entity
Temp lates
M ost web applications that work with data have pages
that display information pertaining to a single item, as well
as allow users to create new or modify existing items one at
a time. Figure 4.1 shows an example of such page, which
displays a single customer record from the Northwind
sample database. Aside from the obvious lack of visual
polish, driven by the need to keep the code examples
simple, this type of page is common in internal, commer-
cial, and packaged web applications today. You can easily
find similar pages that display customer profiles on online
retailers' websites or customer information in commercial
CRM (customer relationship management) systems.
. Entity Template Lookup Rules
. Built-in Entity Templates
Implementing pages like this with ASP.NET is straightfor-
ward. Typical pages, like the one shown in Figure 4.1, can
use a data source control, the EntityDataSource in this
example, to retrieve the record from thedatabase. The data
source control is associated with a presentation control,
such as the FormView , which uses one or more databound
controls to display the field values.
In Chapter 3, “Field Templates,” you saw how Dynamic
Data makes the task of creating data-driven pages easier by
providing Field Templates, a special type of user control
that encapsulate presentation and business logic for individ-
ual field values of different column types. You can use field
templates by adding DynamicControl instances to the page
and specifying their DataField properties to indicate the
column for which a field template is needed.
DynamicControl chooses an appropriate field template based
on the metadata information that describes the column,
and the field template uses appropriate controls to format
and display the field value.
 
Search WWH ::




Custom Search