Search code examples
c#asp.netservercontrols

How to retrieve style of the HTML server control programmatically?


Suppose i'm having <div> tag with id="toggleText" & runat="Server" then i can change style attributes by using following -

toggleText.Style.Add("Display", "block");

But if i want to retrieve the style attribute then how to do this?

thanks


Solution

  • Easy:

     toggleText.Style["Display"];