Alex Rivera | Logout

How to add style from code behind?

Asked 2010-01-05T08:11:08.507
20

I want to add a style A:Hover to a HyperLink control from code behind.

I can do like this :

HyperLink hlRow = new HyperLink();
hlRow.Style.Add("color", "#000000");
hlRow.Style.Add("text-decoration", "none");

But how can I add styles for A:Hover for the hyperlink control? Do I need to define a class and associate that class with this control, if yes how?

Edit
Report

1 Answer

2

Also make sure the aspx page has AutoEventWireup="true" and not AutoEventWireup="false"

answered 2011-06-21T20:36:07.997

Your Answer