Click here to Skip to main content
16,011,868 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi all..
pls tell me,
Q. How to use css from code-behind in asp.net
Posted

1 solution

It can be done by many ways.
as
make css and assign at runtime as
C#
Pabel1.CssClass = "someCssClass"

or
C#
TextBox1.Style.Add("Background-color", "#ccc");

or

C#
TextBox1.Attributes.Add("style", "Background-color:#ccc");
 
Share this answer
 
Comments
Rajeev prasad yadav 21-Dec-11 5:27am    
Mr Patel:

A lot of thanks to you. That's very useful code given by you

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