In This Article, I'll Show You How To Use Repeater in
In This Article, I'll Show You How To Use Repeater in
I store the user in table "Client_NetroStar" in SQL Server. There are five fields in the table:
ID
Login
FirstName
LastName
DateAdded
HeaderTemplate - template for elements that you want to render once before your
ItemTemplate section.
ItemTemplate - template for elements that are rendered once per row of data.
AlternatingItemTemplate - template for elements that are rendered every other row of
data. This allows you to alternate background colors, for example.
SeparatorTemplate - template for elements to render between each row, such as line
breaks.
FooterTemplate - template for elements that you want to render once after your
ItemTemplate section.
The Repeater has an attribute ID= "rptList". It is used in Code Behind
(ClientNetroStar.aspx.cs) . Repeater uses the HeaderTemplate to insert <table> . Then it uses the
ItemTemplate to display a LinkButton control that has our data in it. I'll come back to this in the
next step.
The first five lines open a database connection and retrieve the contents of the Client_NetroStar
table. The last two lines bind our Repeater control to the DataReader.