Reputation: 731
I want to access custom attribute in the code behind, how can I?
e.g. my server control
<asp:HyperLink ID="id_1" runat="server" Target="_blank" NavigateUrl="xyz" Style="color:red"></HyperLink>
'Style' is not an Attribute of HyperLink as a result it is not rendered in the HTML, so I want to access the Style value in c# code behind and once I access it i can dom something like below which works.
id_1.Attributes.Add("Style","color:red");
Any help is appreciated. If you guys have any other suggestion, that is appreciated as well.
Upvotes: 0
Views: 3187