ASP.NET
  Home arrow ASP.NET arrow Page 2 - ADO.NET 101: Data Rendering with a Repeate...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

ADO.NET 101: Data Rendering with a Repeater Control Introduction
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2005-11-16

    Table of Contents:
  • ADO.NET 101: Data Rendering with a Repeater Control Introduction
  • Displaying Data from DataReader with a Repeater Control
  • Configuring the Item
  • Displayed data from DataReader

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ADO.NET 101: Data Rendering with a Repeater Control Introduction - Displaying Data from DataReader with a Repeater Control


    (Page 2 of 4 )

    IDE related details of Repeater Control

    The next picture shows a Repeater Control placed on the design pane of a web form. The corresponding html generated is:

    <asp:Repeater id="Repeater2" runat="server">
    </asp:Repeater>
    .Repeater Control

    Since the repeater control orchestrates a series of html templates, it will be necessary to insert the html formatting into the control. The VS 2003 IDE gives a dropdown cue as to the different templates built-in for this purpose. As soon as you insert a < tag in the Repeater Control you will see this drop-down menu, from which the Header template has just been inserted. The header and footer templates serve the purpose of providing the information that is suggested by their names, for example the column names of a table in the header and some aggregate information, or date in the footer.

    The ItemTemplate is where row after row of data gets in. The Header and Footer templates are rendered only once since they are needed only once. If they are not defined, they are not rendered. The Alternating ItemTemplate is a part of the same ItemTemplate but helps in optionally rendering the alternate rows of the ItemTemplate for better readability of data. Again, it is rendered only if it is defined, not otherwise. The ItemTemplate is however, mandatory.

    Templates of Repeater Control

    Although the template tags are provided, what goes into the various templates will depend on the data that is going to be displayed, and any special formatting that may need to be applied. This next picture shows how a table is going to be inserted as a part of the Repeater Control, where a couple of columns with their column headings are inserted into the HeaderTemplate portion of the Repeater Control. How do I know what the columns are? Well, since I am designing this to bring in data from a data reader to the Repeater Control, I know a priori the field (column) names that are going to be displayed (review my SQLCommand's CommandText property in the next section).

    Laying out the templates

    More ASP.NET Articles
    More By Jayaram Krishnaswamy


       · This first of the three articles deals with Data bound controls using the VS 2003...
       · Hello, can you please extend your series to "nesting data web controls". Something...
       · This may not be possible as these controls do not support drag and drop...
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT