How to Use ASP.NET Repeater Control

If you don’t know how you can loop out datasets and build tables and you do not know how you can display raw data with just one column, ASP.NET repeater control can provide you with what you’ve been missing. First create page then insert the repeater control. Then get the data you need to have a repeater control. Here is a sample of the code and what you can do with repeater control:

  1. ….
  2. <asp:Repeater ID=”catlist” runat=”server”>
  3. <HeaderTemplate>
  4. <tr>
  5. <td class=”imgspace”>
  6. <img src=”Images/areas.jpg” width=”91″ height=”28″ class=”bigtext”>
  7. </td>
  8. </tr>
  9. </HeaderTemplate>
  10. <ItemTemplate>
  11. <tr>
  12. <td>
  13. <div align=center>
  14. <asp:HyperLink class=”text”
  15. NavigateUrl=”<%# “mainframeset.aspx?CatType=” +
  16. DataBinder.Eval(Container.DataItem,”Sub_Category_ID”)%>”
  17. Text=”<%#DataBinder.Eval(Container.DataItem, “Sub_Category_Text”)%>”
  18. runat=”server” target=”mainFrame” ID=”Hyperlink1″ NAME=”Hyperlink1″/>
  19. <br></div>
  20. </td>
  21. </tr>
  22. </ItemTemplate>
  23. <FooterTemplate>
  24. <tr>
  25. <td>

Read the rest of the article here:

Leave a Reply

Your email address will not be published. Required fields are marked *