Hour 15. Displaying Data with the Data Web Controls


In this hour, we will cover

  • Associating data Web controls with data source controls

  • Using the GridView and DetailsView controls

  • Customizing the appearance of the GridView and DetailsView controls

  • Displaying only a subset of data source columns in a data Web control

Displaying data in an ASP.NET page requires using two classes of Web controls. First, a data source control is used to access the data; next, a data Web control is employed to display the data retrieved by the data source control. In the preceding hour we discussed what data source controls are, focusing in on the SqlDataSource control. In this hour we'll turn our attention to the data Web controls, which are a suite of controls that display the data from a data source control.

Just like the data source controls have a single jobto retrieve data from some data sourcethe data Web controls, too, have a single functionto display data. Therefore, the data Web controls do not provide any functionality to actually retrieve data. Instead, they simply take data from a data source and render it in an ASP.NET page. The data Web controls' differences lie in how they render the underlying data. For example, the GridView control displays data in a grid, with one row for each record in the data source control. There are also controls for displaying one record from the data source control at a time.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

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