Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <style>
  2. .red
  3. {
  4. background-color:pink;
  5. color:red;
  6. }
  7. </style>
  8.  
  9. <asp:ListBox ID="ListBox1" runat="server">
  10. <asp:ListItem Text="A" Disabled="disabled" Class="red"></asp:ListItem>
  11. <asp:ListItem Text="Adam"></asp:ListItem>
  12. <asp:ListItem Text="Ami"></asp:ListItem>
  13. <asp:ListItem Text="B" Disabled="disabled" Class="red"></asp:ListItem>
  14. <asp:ListItem Text="Bob"></asp:ListItem>
  15. <asp:ListItem Text="K" Disabled="disabled" Class="red"></asp:ListItem>
  16. <asp:ListItem Text="Kim"></asp:ListItem>
  17. <asp:ListItem Text="L" Disabled="disabled" Class="red"></asp:ListItem>
  18. <asp:ListItem Text="Lena"></asp:ListItem>
  19. <asp:ListItem Text="Leo"></asp:ListItem>
  20. <asp:ListItem Text="Limi"></asp:ListItem>
  21. </asp:ListBox>
  22.  
  23. ListItem x = new ListItem("A"));
  24. x.Attributes.Add("class","red");
  25. ListBox1.Items.Add(x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement