O'Reilly logo

Build Your Own ASP.NET 4 Web Site Using C# & VB, 4th Edition by Cristian Darie, Wyatt Barnett, Timmothy Posey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10Displaying Content Using Data Lists

Similar to the Repeater control, the DataList control allows you to bind and customize the presentation of database data. The fundamental difference is that while the Repeater requires building the template from scratch (allowing you to customize the generated HTML output in any way you like), the DataList control automatically generates a single-column HTML table for you, like the one shown below:

<table> <tr> <td> <p>Employee ID: 1</p> <p>Name: Zak Ruvalcaba</p> <p>Username: zak</p> </td> </tr> <tr> <td> <p>Employee ID: 2</p> <p>Name: Jessica Ruvalcaba</p> <p>Username: jessica</p> </td> </tr> <tr> <td> <p>Employee ID: 3</p> <p>Name: Ted Lindsey</p> <p>Username: ted</p> </td> </tr> … </table> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required