Monday, December 6, 2010

How to Add CSS dynamically to controls in C#, ASP.NET

To add style Dynamically just add this code snippet.
Control_ID.Style.Add("color","#FFFF99");
As in the above example I had just given a example to change the font color dynamically. You can use another method to add the style to the control dynamically... Like
Control_ID.Attribute.Add("Style='color:#FFFF99;'");

No comments:

Post a Comment