Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
I have css file named
sample.css<br />
in that file added one class
CSS
.lblcss
{
color:#fff;
boder-color:#ff122;
background color:black;
}

now i want to change color to red using c# code dynamically.
can you help me??
i mean how get css file into cs file??
and modify??
Posted
Updated 20-Nov-14 10:46am
v2
Comments
Philippe Mori 20-Nov-14 20:25pm    
CSS files are usually cached so changes won't be seen immediatly by some clients. You often need to do Ctrl+F5 when you change the CSS.

If only a few styles change, then I think you should write those directly in the ASPX page as I would do for small script function that need to chnage dynamically. However, I won't recommand that if you have a lot of styles to generated.
On the other hand, using jquery to adjust styles might make more senses in some scenarios.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900