Chapter 11. Using the ASP.NET EntityDataSource Control

With the Entity Framework you can build both Rapid Application Development (RAD) applications and highly architected applications. On the RAD end, the ASP.NET EntityDataSource control enables quick declarative data binding that you can use in a number of scenarios.

In this chapter, you will build two ASP.NET web applications using entities that make use of the EntityDataSource control. The first application will introduce you to the EntityDataSource, and the second will add some more complexity, featuring hierarchical data as well as greater interaction between the controls. After you build the examples, the chapter will bring you on a tour of some of the more interesting features of the EntityDataSource control.

The EntityDataSource control allows you to define a data source for binding your data to controls in the UI, using markup syntax. It is related to the other ASP.NET DataSource controls, such as SqlDataSource and LinqDataSource.

Using entities in web applications can be challenging because the ObjectContext does not survive postbacks and therefore cannot do its job of keeping track of changes to your entities. The EntityDataSource control helps you to resolve many of the challenges in scenarios where you do not need to use a business or data access layer. Later in the book, after you have learned about the Entity Framework in more detail, you will learn about building layered ASP.NET applications.

This chapter will give ...

Get Programming Entity Framework 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.