asp.net.ph

Repeater Class

System.Web.UI.WebControls Namespace


A data-bound list control that renders its content using a specified template for each item in the list.

Repeater Class Members

Collapse   Constructors

Visibility Constructor Parameters
public Repeater ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public AlternatingItemTemplate ITemplate [ Get , Set ]
public Controls ControlCollection [ Get ]
public DataMember String [ Get , Set ]
public DataSource Object [ Get , Set ]
public DataSourceID String [ Get , Set ]
public EnableTheming Boolean [ Get , Set ]
public FooterTemplate ITemplate [ Get , Set ]
public HeaderTemplate ITemplate [ Get , Set ]
public Items RepeaterItemCollection [ Get ]
public ItemTemplate ITemplate [ Get , Set ]
public ItemType String [ Get , Set ]
public SelectMethod String [ Get , Set ]
public SeparatorTemplate ITemplate [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected CreateControlHierarchy ( Boolean useDataSource ) Void
protected CreateDataSourceSelectArguments ( ) DataSourceSelectArguments
protected CreateItem ( Int32 itemIndex , ListItemType itemType ) RepeaterItem
public DataBind ( ) Void
protected EnsureDataBound ( ) Void
protected GetData ( ) IEnumerable
protected InitializeItem ( RepeaterItem item ) Void
protected LoadViewState ( Object savedState ) Void
protected OnBubbleEvent ( Object sender , EventArgs e ) Boolean
protected OnCreatingModelDataSource ( CreatingModelDataSourceEventArgs e ) Void
protected OnDataBinding ( EventArgs e ) Void
protected OnDataPropertyChanged ( ) Void
protected OnDataSourceViewChanged ( Object sender , EventArgs e ) Void
protected OnItemCommand ( RepeaterCommandEventArgs e ) Void
protected OnItemCreated ( RepeaterItemEventArgs e ) Void
protected OnItemDataBound ( RepeaterItemEventArgs e ) Void
protected SaveViewState ( ) Object
protected TrackViewState ( ) Void

Remarks

The Repeater is a data-bound container control that uses templates to define the rendering of its content. The control has no built-in layout or style; all HTML layout, formatting, and style tags must be explicitly declared within the control's templates.

At a minimum, every Repeater must define an ItemTemplate, though optional templates are available to customize the appearance of the list:

Template Name Description
ItemTemplate Defines the content and layout of items within the list. This template is required.
AlternatingItemTemplate If defined, this determines the content and layout of alternating ( zero-based odd-indexed ) items. If not defined, ItemTemplate is used.
HeaderTemplate If defined, this determines the content and layout of the list header. If not defined, a header is not rendered.
FooterTemplate If defined, this determines the content and layout of the list footer. If not defined, a footer is not rendered.
SeparatorTemplate If defined, this is rendered between items ( and alternating items ). If not defined, a separator is not rendered.

A Repeater has no built-in selection or editing support. The control includes the ItemCommand event, though, which can be used to handle events that are raised from the templates and passed to the control.

A Repeater binds its ItemTemplate and AlternatingItemTemplate to a data model referenced by its DataSource property. The HeaderTemplate, FooterTemplate, and SeparatorTemplate are not data-bound.

If the data source is not set, the Repeater is not rendered. If the data source is set but no data is returned, the control renders the HeaderTemplate and FooterTemplate, with no items.

For examples illustrating use of this control, see the individual member types of this class. For syntax information, see Repeater in ASP.NET Syntax for Web Controls.

See Also

Working with the Repeater Control Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph