- Back to Home »
- Add Styles Dynamicaly
Posted by : Unknown
Sunday, 15 June 2014
Here is the way to add styles content dynamically i.e with in the code . Here control name is "Test"
test.Style.Add("display", "none");
or
test.Attributes.Add("style", "text-align: center;");
or
test.Attributes.Add("class", "centerIt");
or
test.Attributes["style"] = "text-align: center;";
or
test.Attributes["class"] = "centerIt";