Chapter 7: List Controls and Data Binding


Overview

Most dynamic web sites, and just about every web application, will need to access a data source at some point. ASP has long been capable of accessing various kinds of data store, such as relational databases, email servers, XML documents, or text files and it's relatively simple to manipulate, format, and display data in a range of ways. However, although it's simple to do, it always requires writing code “ and that code can become quite extensive , making it difficult to manage and debug.

ASP.NET introduces some new ways to manage and present data of all kinds. In later chapters, you'll look at the whole concept of data management for both relational and XML data. However, in this chapter you will look at new ways to display data in your web pages and applications.

Data presentation in ASP.NET is managed mainly through a series of new server controls that are specially designed to work with a whole range of types of data “ not just relational or XML data. Thus, the techniques for working with these controls are akin to the techniques for creating ASP.NET pages that we've examined in previous chapters.

What's more, you don't need a deep understanding of where the data comes from, or how it is extracted from a data store, to be able to use the new data presentation controls. The fundamentally disconnected design of the data management features within the .NET Framework enables you to easily separate the business rules that create and expose the data from the code that creates the display.

In this chapter, you'll deal with the way the controls work, and how you use them. In later chapters, we'll be free to examine relational and XML data management techniques, without getting bogged down with presentation issues. The topics covered here are:

  • What data binding actually is, and how it works.

  • How to bind controls to single data values.

  • How to bind list controls to sets of data values.

  • How to change the appearance of data-bound controls.

  • How to use data-bound controls to edit and update the source data.




Professional ASP. NET 1.1
Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)
ISBN: 0470384611
EAN: 2147483647
Year: 2006
Pages: 243

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net