O'Reilly logo

ASP.NET 4 24-Hour Trainer by Toi B. Wright

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

Chapter 21A. Dynamic Data in Web Forms

Dynamic Data is a framework that enables you to create a fully functional data-driven web application in only five minutes. In the previous lessons I have shown you how to extend the simple sample application that Microsoft Visual Web Developer 2010 Express creates when you use the ASP.NET Web Application template. In this lesson I show you how to create a data-driven application that uses the Dynamic Data framework.

Microsoft Visual Web Developer 2010 Express provides two different templates for creating applications that use Dynamic Data:

  • ASP.NET Dynamic Data Entities Web Application — This template uses an Entity Data Model to access the data.

  • ASP.NET Dynamic Data Linq to SQL Web Application — This template uses LINQ to SQL to access the data.

THE DYNAMIC DATA ENTITIES WEB APPLICATION TEMPLATE

In this lesson I use the ASP.NET Dynamic Data Entities Web Application template. Unlike with the other templates that I have demonstrated in this book, you cannot immediately run a new web application that uses the Dynamic Data framework. Instead, you must do two things before the application can run:

  1. Add an Entity Data Model.

  2. Update the Global.asax file.

Figure 21A-1 shows the Entity Data Model (EDM) that I use in this lesson. This is the same model I used in Lesson 20A.

FIGURE 21A-1

Figure 21A.1. FIGURE 21A-1

The namespace for the EDM is Models and the entity container is ...

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