Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

May 19, 2010

Change CSS of a ASP.NET control at runtime. (C#)

Let's add background color and width  to a Label control at runtime.
(Runtime means on button click event or something like that).

Label1.Attributes.CssStyle.Add("background-color", "#007700");
Label1.Attributes.CssStyle.Add("width", "320px");