Web Studyaspnet.blogspot.com Babyneed.blogspot.com

ASP.Net Web Developer Guide

Power By: eXTReMe Tracker Powered by Blogger  
 
 
 
 

 

 
Important Links
 
   
     
 
Sitemap
 
   
   
 
Reference
 
   

Monday, March 27, 2006

Using the Repeater Server Control (Chapter 3)

The Repeater is essentially a template-driven data-bound list.The Repeater control allows fragments of html tags inside the templates. For example, we may start a <table> in the Header template and end the table (</table>) in the Footer template, if necessary.The control binds its Item collection to the its DataSource.We may use the Item Command event to process events that are raised from the templates of the control.
We may specify the following templates for a Repeater control:
  • Item Template Specifies the DataItem fields to be displayed, and the layout (required).

  • AlternatingItemTemplate Defines the layout of the zero-based odd indexed items (optional).

  • SeparatorTemplate In this template, we can specify the separator such as <hr> or <br> between repeating items (optional).

  • HeaderTemplate Specifies the header of the list (optional).

  • FooterTemplate Specifies the footer of the list (optional).
We will provide two examples to illustrate the behavior of a repeater control. In the first example, we will display our product information using a repeater control. In the second example, we will illustrate how to capture an event from a control residing inside a repeater control (known as Event Bubbling).

0 Comments:

Post a Comment

<< Home