Databases Reference
In-Depth Information
In particular, you need to create a DynamicDataRoute and register it in the global
RouteTable . The route object defines a special URL format where the traditional
QueryString parameters become a part of the virtual path. In this example, the route
defines a {table} parameter, so instead of a URL like
http://server/DynamicData/PageTemplates/Edit.aspx?table=Products
you could simply type
http://server/Products/Edit.aspx.
Another parameter in this route is {action} . Action usually matches the name of one of
the available page templates, such as the built-in List, Details, Edit, and Insert.
In Listing 1.19, you might have also noticed that in this code the NorthwindEntities data
model is registered with a ContextConfiguration object. The ContextConfiguration
allows you to provide additional information to Dynamic Data regarding the data model,
such as specify that all tables should be scaffolded by default. Scaffolding a table means
making it visible to the user in the UI generated by Dynamic Data. Usually, you scaffold
only those few tables you want your user to be able to view and edit directly. However, in
this example, all of them are scaffolded to illustrate the use of page templates.
Figure 1.19 shows the default home page provided for web applications by the Dynamic
Data project template.
FIGURE 1.19
Default home page of a Dynamic Data Web Application.
Search WWH ::




Custom Search