Thuộc tính Rows ASP.NET

Định nghĩa và cách sử dụng

Thuộc tính Rows được sử dụng để lấy hoặc thiết lập số lượng hàng hiển thị trong ListBox (không cuộn).

Cú pháp

<asp:ListBox Rows="num" runat="server">
some content
</asp:ListBox>
Thuộc tính Mô tả
num Định nghĩa số lượng hàng hiển thị trong ListBox (không cuộn).

Mẫu

Dưới đây là ví dụ thiết lập thuộc tính Rows của ListBox:

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

Mẫu

Cài đặt thuộc tính Rows của ListBox