Understanding Repeater Controls in ASP.NET

ASP.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.

| What is the need for Bridge Pattern in C#? | What is the need for Builder Pattern in C#? | What is the need for Chain of Responsibility Pattern in C#? | What is the need for Command Pattern in C#? | What is the need for Composite Pattern in C#? | What is the need for Decorator Pattern in C#? | What is the need for Flyweight Pattern in C#? | What is the need for Interpreter Pattern in C#? | What is the need for Iterator Pattern in C#? | What is the need for Mediator Pattern in C#? | What is the need for Memento Pattern in C#? | What is the need for Prototype Pattern in C#? | What is the need for State Pattern in C#? | What is the need for Strategy Pattern in C#? | What is the need for Template Method Pattern in C#? | What is the need for unsafe code in C#? | What is the purpose of assert() in C#? | What is the purpose of AutoResetEvent in .NET? | What is the purpose of Console.ReadLine() in C#? | What is the purpose of machine.config file in .NET? |


“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2024 - All Rights Reserved.