<div ID="btnWebL" runat="server" class="left_selected"></div>
<asp:LinkButton ID="btnWeb" runat="server" CssClass="center_selected" OnClick="btnWeb_Click"
Text="<%$ Resources:ViaMura.Web.Default, WebSearchButtonText %>"></asp:LinkButton>
<div ID="btnWebR" runat="server" class="right_selected"></div>
i want to change btnWeb class to left_not_selected.
I try with:
HtmlControl btnWebL = FindControl("btnWebL") as HtmlControl;
but btnWebL does not have property for changing class. How can i change class?
You should be able to set the class
attribute like so:
bntWebL.Attributes["class"] = "your_new_class";
See the documentation here.
Try this code
HtmlControl btnWebL = FindControl("btnWebL") as HtmlControl;
bntWebL.Attributes["class"] = "left_not_selected";
I hope this will work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With