Displaying Data

GridView renders its data items in an HTML table. Each data item renders in a distinct HTML table row. For example, the page in Listing 11.1 demonstrates how you can use GridView to display the contents of the Movies database table (see Figure 11.1).

Figure 11.1. Displaying data with the GridView control.

image

Listing 11.1. ShowMovies.aspx

images

In Listing 11.1, the GridView control is bound to a SqlDataSource control, which represents the Movies database table. The GridView associates with its data source through its DataSourceID property. ...

Get ASP.NET 4 Unleashed 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.