ASP.NET ListItem Enabled 屬性
定義和用法
Enabled 屬性用於設置或返回是否默認地啟用ListItem。
如果該屬性設置為TRUE,則ListItem 默認地被啟用,否則為FALSE。 默認是TRUE。
語法
<asp:ListItem Enabled="True|False" runat="server" />
實例
下面的實例禁用了ListBox 控件中的一個ListItem:
<form runat="server">
<asp:ListBox runat="server">
<asp:ListItem Text="Item1" Enabled="False"/>
<asp:ListItem Text="Item2" />
</asp:ListBox>
</form>
<asp:ListBox runat="server">
<asp:ListItem Text="Item1" Enabled="False"/>
<asp:ListItem Text="Item2" />
</asp:ListBox>
</form>
演示實例»
ListItem控件