Can I assign more than one "CssClass" to a control in asp.net?How to do this?
+9
A:
To assign class "myClass1" and "myClass2" you simply say:
<asp:Label runat="server" CssClass="myClass1 myClass2" />
This is the same approach you'd use in normal HTML as in:
<div class="myClass1 myClass2"></div>
Larsenal
2009-01-31 00:34:55
A:
You can try the eqivalent of:
class="class1 class2"
So if it's a property just try throwing the classes with a space between them in there.
Sam
2009-01-31 00:36:04
A:
I imagine it's just like setting the class attribute in an XHTML element.
<p class="foo bar"></p>
<asp:Something CssClass="foo bar" runat="server" />
Matt Olenik
2009-01-31 00:36:41
+2
A:
If you wanted to add another class programmatically and don't know what classes have already been added
MyControl.CssClass += " newclass";
Khb
2009-01-31 00:39:36