So it looks like if I add style such as background color to LinkButton in my .cs code, it overrides any css I have that applies to it.
is there any way to add style rather than replace it in my code behind? Thanks! I am using link button as a menu, so active linkButton should have different background color. so my solution was when the user clicks on the link button in my event handler I do something like:
lnkView.BackColor = System.Drawing.Color.FromName("#369");
But then my hover style which I have in my css will no longer work:
.navlist a:hover
{
color: #fff;
background-color: #369;
text-decoration: none;
}
in my aspx:
<ul class="navlist">
<li><asp:LinkButton ID="lnkView" runat="server">view</asp:LinkButton></li>
<li><asp:LinkButton ID="lnkCreateNew" runat="server">create new</asp:LinkButton></li>
</ul>