In Lesson 21A you created a fully functional data-driven application by writing only one line of code. The Dynamic Data framework uses templates to provide the default views for data. It uses entity templates, field templates, and page templates. In this lesson I show you how to customize a page template and how to create a new field template.
The Dynamic Data framework uses five page templates. All of the page templates are just regular ASPX pages. They are:
Details.aspx — This page displays the data from a single row of the table.
Edit.aspx — This page allows you to edit the data from a single row of the table.
Insert.aspx — This page allows you to insert a row into the table.
List.aspx — This page lists all of the rows in the table using a
ListDetails.aspx — This page lists all of the rows in the table using a
GridView control and allows you to edit and insert rows using a
If you make a change to any of the pages in the PageTemplates folder, it will have a global effect on your application. Figure 22A-1 shows the default
List.aspx page template.
As you can see the
GridView that is used on the default
List.aspx page template is not formatted to show alternating rows in a different color. This is the code to have alternating rows of a
GridView appear yellow:
<AlternatingRowStyle BackColor="#FFFF99" />
Figure 22A.1. FIGURE 22A-1
If I add the preceding markup to the