ASP.NET RowsProperty
ListBox Control
Definition and Usage
The property is used to get or set the number of visible rows (without scrolling) in the ListBox.
Syntax
<asp:ListBox Rows="num" runat="server">
Some Content
</asp:ListBox>
Some Content
</asp:ListBox>
| Property | Description |
|---|---|
| num | Specifies the number of visible rows (without scrolling) in the ListBox. |
Example
The following example sets the Rows property of the ListBox control:
<form runat="server">
<asp:ListBox id="lb1" Rows="5" runat="server">
<asp:ListItem Value="Item1" />
<asp:ListItem Value="Item2" />
<asp:ListItem Value="Item3" />
<asp:ListItem Value="Item4" />
<asp:ListItem Value="Item5" />
</asp:ListBox>
</form>
<asp:ListBox id="lb1" Rows="5" runat="server">
<asp:ListItem Value="Item1" />
<asp:ListItem Value="Item2" />
<asp:ListItem Value="Item3" />
<asp:ListItem Value="Item4" />
<asp:ListItem Value="Item5" />
</asp:ListBox>
</form>
Demo »
ListBox Control Other Extensions