asp.net control repeater description

Source: Internet
Author: User

asp.net control repeater description

Create a Repeater control in the. aspx page. The contents of the <HeaderTemplate> element appear only once in the output, and the contents of the <ItemTemplate> element are repeated to the "record" in the DataSet, and finally, the <footertemplate The content of > appears only once in the output.
Add <AlternatingItemTemplate> elements after the <ItemTemplate> element so that you can describe the appearance of alternating rows.
The <SeparatorTemplate> element can be used to describe the separator between each record.

Example:

 
  1. <form runat= "Server" >
  2. <asp:repeater id= "Cdcatalog" runat= "Server" >
  3. <HeaderTemplate>
  4. <table border= "1" width= "100%" >
  5. <tr>
  6. <th>Title</th>
  7. <th>Artist</th>
  8. <th>Country</th>
  9. <th>Company</th>
  10. <th>Price</th>
  11. <th>Year</th>
  12. </tr>
  13. </HeaderTemplate>
  14. <ItemTemplate>
  15. <tr>
  16. <td><% #Container. DataItem ("title")%></td>
  17. <td><% #Container. DataItem ("artist")%></td>
  18. <td><% #Container. DataItem ("Country")%></td>
  19. <td><% #Container. DataItem ("Company")%></td>
  20. <td><% #Container. DataItem ("Price")%></td>
  21. <td><% #Container. DataItem ("year")%></td>
  22. </tr>
  23. </ItemTemplate>
  24. <AlternatingItemTemplate>
  25. <tr bgcolor= "#e8e8e8" >
  26. <td><% #Container. DataItem ("title")%></td>
  27. <td><% #Container. DataItem ("artist")%></td>
  28. <td><% #Container. DataItem ("Country")%></td>
  29. <td><% #Container. DataItem ("Company")%></td>
  30. <td><% #Container. DataItem ("Price")%></td>
  31. <td><% #Container. DataItem ("year")%></td>
  32. </tr>
  33. </AlternatingItemTemplate>
  34. <SeparatorTemplate>
  35. <tr>
  36. <TD colspan= "6" >
  37. </tr>
  38. </SeparatorTemplate>
  39. <FooterTemplate>
  40. </table>
  41. </FooterTemplate>
  42. </asp:Repeater>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.