## ASP.NET CheckBoxList RepeatLayout Property
The `RepeatLayout` property is a key layout configuration option for the ASP.NET Web Forms `CheckBoxList` control. It determines how the individual checkbox items within the list are structured and rendered in the final HTML output.
---
## Definition and Usage
The `RepeatLayout` property gets or sets the layout structure used to display the items in a `CheckBoxList` control.
By default, ASP.NET renders a `CheckBoxList` using an HTML `
` element to align the items. However, depending on your modern CSS layout requirements (such as Flexbox or Grid), you may want to render them as inline flow elements or semantic list items.
---
## Syntax
```xml
```
### Property Values
| Value | Description |
| :--- | :--- |
| **Table** | *(Default)* The list items are rendered inside an HTML `` structure. This is ideal for traditional, rigid grid alignments. |
| **Flow** | The list items are rendered as inline flow elements (typically wrapped in `` tags) without a table structure. This is ideal for custom CSS styling and responsive designs. |
| **OrderedList** | The list items are rendered as list items (``) within an ordered list (``). *(Available in .NET Framework 4.0+)* |
| **UnorderedList** | The list items are rendered as list items (`- `) within an unordered list (`
`). *(Available in .NET Framework 4.0+)* |
---
## Code Examples
### Example 1: Flow Layout (No Table)
The following example demonstrates how to set the `RepeatLayout` property to `Flow`. This prevents ASP.NET from generating table tags, making it easier to style the checkboxes horizontally or responsively using CSS.
```xml
<%@ Page Language="C#" %>
CheckBoxList RepeatLayout Example
```
### Example 2: Default Table Layout
If you do not specify the `RepeatLayout` property, it defaults to `Table`.
```xml
```
---
## Technical Considerations
* **Modern Web Standards:** For modern, responsive web designs, it is highly recommended to use `Flow`, `UnorderedList`, or `OrderedList` instead of `Table`. This allows you to easily manipulate the layout using CSS Flexbox or CSS Grid.
* **Interaction with `RepeatDirection`:**
* When using `RepeatLayout="Table"`, the `RepeatDirection` property (Horizontal/Vertical) determines whether the table cells are populated row-by-row or column-by-column.
* When using `RepeatLayout="Flow"`, the layout relies heavily on browser rendering and your custom CSS.
* **Accessibility:** Using `UnorderedList` or `OrderedList` provides better semantic HTML, which improves accessibility for screen readers.