Understanding Repeater Controls in ASP.NETASP.NET Repeater Control is one of the control in List control, the other two being DataList control and DataGrid control. List control is extensively used in web applications to show a list of data such as strings or data items from the database. The list of data may not be displayed in the web application because this will take more space. If you place a list control such as drop down list in a web application, you can contain all the data in one control.
ASP.NET Repeater Control is the easiest one of the list controls to create. It is simply adding a numbers of items underneath each other. This type of control will be ideally suited for displaying a list of hyperlinks in a web application. You can use the ASP.NET Repeater Control by creating templates that defines the layout of the control's content. A template can contain any grouping of HTML text and controls that are applicable on a Web Forms page. While running the application you cannot view the ASP.NET Repeater Control if not even a single template is defined, or if none of the templates contain elements. The ASP.NET Repeater Control supports four types of templates: ItemTemplate, AlternatingItemTemplate, HeaderTemplate and FooterTemplate, and SeparatorTemplate. A ASP.NET Repeater Control does not have any default look. You have to define the way how the information should look like. Therefore, it is possible for you to display items in a ASP.NET Repeater Control in a table layout, in a comma-delimited list, in a bulleted list or in a numbered list. The ASP.NET Repeater Control will not render the result unless you bound it to a data source through its DataSource property. The ASP.NET Repeater Control supports several events such as ItemCreated, ItemCommand, ItemDataBound, Load, and Unload. These events help developer to create an event when the user clicks the button.
|