Class wwWebRepeater

The WebRepeater class provides a template driven repeatable display bound to a datasource. The repeater supports Cursors, Object Arrays and Object Collections for databinding.

Repeaters work by using templates for displaying content. It has an ItemTemplate, Alternating Item template footer and header templates which can in turn contain other controls, expressions and literal text.

<ww:wwWebRepeater runat="server" id="repItems" 
               ItemChanged="repItems_ItemChanged" DataSource="tt_cust">
   <h1>Customer List</h1>
   Company:  <ww:wwWebLabel runat="server" Text="hello" ControlSource=""></ww:wwWebLabel> 
   Name:  <%= tt_cust.Careof %>
   <small>generated at: <%= DateTime() %></small>

In order for the ControlSource binding to work you have to call DataBind() on the repeater either explicitly or through the Page's DataBind() method. <%= Expression %> binding always works regardless of whether DataBind() was called or not.



Any child controls that are rendered inside of a repeater only call OnInit() for performance reasons. This means that some controls may not work as expected. The reason is performance and also the fact that repeater renders data items as part of the .Render() process of the page and doesn't run through the full page cycle of events.

Class Members



Event that fires just after a new item has been loaded. You can hook this event to affect processing that occurs just before the data item is rendered.


Event that is fired when an each item is databound in the ItemTemplate.


Called just before a data item is rendered. This event occurs after control state - if any - has been restored


The currently active Item template instance while iterating over items. You can use this object in ItemDataBind() to grab the current template object if necessary.


Determines whether child controls are databound in item templates. Set to false to improve performance when you don't have Web Controls that require DataBind() to fire inside of a template and want to improve rendering speed.


The DataSource that is bound to this control. Can be a Cursor, Array of objects or a collection of Objects.


1 - Cursor/Table
2 - One Dimensional Object Array
3 - Collection of Objects


Flag that determines if during rendering an alternating item is active.


Maximum number of items to display in this list. 0 means display all.


Text string/html to display if there's no data to display, ie. the datasource contains no data.

© West Wind Technologies, 1996-2024 • Updated: 01/07/12
Comment or report problem with topic