LinkButton CssClass Not Working – ASP .NET
I have two css classes like this:
.folderTextON,a.folderTextON:active,a.folderTextON:link,a.folderTextON:visited {color:#fff;font:bold 10px/12px Verdana,Arial;text-decoration: none;}
a.folderTextON:hover { text-decoration: none; color: #FFFFFF; }
.folderTextOFF,a.folderTextOFF:active,a.folderTextOFF:link,a.folderTextOFF:visited {color:#AD9596;font:bold 10px/12px Verdana,Arial;text-decoration: none;}
a.folderTextOFF:hover { text-decoration: none; color: #fff; }
I also have LinkButton like this:
<asp:linkbutton id=”linkbtn” CssClass=”folderTextOFF” Runat=”server”>A Link Button</asp:linkbutton>
On code behind I tried to set the css class like this:
linkbtn.CssClass=”folderTextOn“;
This does not not work. On any browser at all. The class code and all others are ok.Whats the problem?
Problem is the CssClass I assigned did not have ON all uppercase as I defined on the style. Modifying that this works:
linkbtn.CssClass=”folderTextON“;
Apparently on code behind class name need to be case sensitive. Whereas it does not matter on the asp page.










Leave your response!