ویژگی Rows ASP.NET

تعریف و استفاده

ویژگی Rows برای دریافت یا تنظیم تعداد خطوط قابل مشاهده در ListBox (بدون اسکرول) استفاده می‌شود.

عبارت

<asp:ListBox Rows="num" runat="server">
محتوای برخی
</asp:ListBox>
ویژگی توضیح
num تعداد خطوط قابل مشاهده در ListBox را تعیین می‌کند (بدون اسکرول).

مثال

در اینجا مثالی برای تنظیم属性 Rows کنترل 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>

مثال

تنظیم属性 Rows کنترل ListBox