Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .red
- {
- background-color:pink;
- color:red;
- }
- </style>
- <asp:ListBox ID="ListBox1" runat="server">
- <asp:ListItem Text="A" Disabled="disabled" Class="red"></asp:ListItem>
- <asp:ListItem Text="Adam"></asp:ListItem>
- <asp:ListItem Text="Ami"></asp:ListItem>
- <asp:ListItem Text="B" Disabled="disabled" Class="red"></asp:ListItem>
- <asp:ListItem Text="Bob"></asp:ListItem>
- <asp:ListItem Text="K" Disabled="disabled" Class="red"></asp:ListItem>
- <asp:ListItem Text="Kim"></asp:ListItem>
- <asp:ListItem Text="L" Disabled="disabled" Class="red"></asp:ListItem>
- <asp:ListItem Text="Lena"></asp:ListItem>
- <asp:ListItem Text="Leo"></asp:ListItem>
- <asp:ListItem Text="Limi"></asp:ListItem>
- </asp:ListBox>
- ListItem x = new ListItem("A"));
- x.Attributes.Add("class","red");
- ListBox1.Items.Add(x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement