Working with Data Source Controls and Data-Bound Controls in ASP.NET

  • 12/10/2010
This chapter from MCTS Self-Paced Training Kit (Exam 70-515): Web Applications Development with Microsoft .NET Framework 4 presents the ASP.NET data source controls, demonstrates how you can bind to data to allow users to interact with it, and presents the new Dynamic Data features of ASP.NET that allow you to easily create websites for working with the CRUD operations of an entire data model that exists as either a DataContext (such as LINQ to SQL) or an ObjectContext (such as LINQ to Entities).

Microsoft ASP.NET provides several server controls that build on top of the features of Microsoft ADO.NET, LINQ to SQL, and LINQ to Entities. These controls simplify the development of data-driven websites. They make it easier to build webpages that access, display, manipulate, and save data. Using these controls can provide development efficiency when you are building business applications that rely heavily on data.

This chapter first presents the ASP.NET data source controls. You use these controls to configure access to data that you intend to use on a webpage. A data source can be a relational database, data stored inside of in-memory objects (such as a DataSet or an Entity Data Model), XML-based data, or data you retrieve via Microsoft Language-Integrated Query (LINQ). The second lesson in this chapter demonstrates how you can bind to data to allow users to interact with it. The lesson covers using web server controls such as GridView, Repeater, DetailsView, and many more. The last lesson presents the new Dynamic Data features of ASP.NET that allow you to easily create websites for working with the create, read, update, and delete (CRUD) operations of an entire data model that exists as either a DataContext (such as LINQ to SQL) or an ObjectContext (such as LINQ to Entities).

Before You Begin

To complete the lessons in this chapter, you should be familiar with developing applications with Microsoft Visual Studio 2010 by using Microsoft Visual Basic or Microsoft Visual C#. In addition, you should be comfortable with all of the following:

  • The Visual Studio 2010 Integrated Development Environment (IDE)

  • Using Hypertext Markup Language (HTML) and client-side scripting

  • Creating ASP.NET websites and forms

  • Adding web server controls to a webpage

  • Understanding how generic types work in C# or Visual Basic

  • Understanding how to use ADO.NET to connect to and work with data

  • Writing LINQ queries and working with LINQ data–specific providers