O'Reilly logo

Sams Teach Yourself ADO.NET in 24 Hours by Paul Bertucci, Jason Lefebvre

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

Working with the Repeater

The Repeater is the most basic of the built-in list control objects, yet offers a great deal of flexibility. To format the data it displays, the Repeater uses templates. Templates are blocks of HTML mixed with server logic that define how each row in the data collection will appear when sent to the client. Templates are defined within the body of the control instantiated within the Web form.

There are a number of different types of templates. The ItemTemplate, as seen in Listing 11.1, is responsible for formatting each record in the collection. The AlternatingItemTemplate lets you define a special appearance for every other item in the collection. A typical use of this would be to define a slightly different color for ...

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