IE7 issue for displaying the corresponding color [Resolved]

Posted by Varaprasadm.84 under CSS 3 on 7/6/2010 | Views : 1550 | Status : [Member] | Replies : 1
Hi, i am having a server control (Asp:Label) and i want to apply the css class dynamically

but it is applying to the label in all browsers except in IE7

in all browsers the dynamic css classes are applying but in IE7 it is not applying

can u give any solution or any alternate solution

i am giving the sample code as:

"((Label)e.Item.FindControl("lblPrice")).Attributes.Add("class", "liforrent");"
I want to apply this class "liforrent" to the label dynamically because the label will contains different colors like red,blue, green

Thanks and Regards, Vara Prasad.M

Vara Prasad.M


Posted by: SheoNarayan on: 7/6/2010 [Administrator] HonoraryPlatinum | Points: 50


You can use something like below
((Label)e.Item.FindControl("lblPrice")).CssClass = "liforrent";

If not, try to see the rendered HTML for this control, how does it look like? Does the span tag for this Label has class attribute?

Also make sure that "liforrent" css class exists in your rendered page or the css class the page is linking to.

Thank you.

Sheo Narayan

Varaprasadm.84, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response