N
Nathan Sokalski
I have a User Control (.ascx & .ascx.vb) for which I need to dynamically
specify certain CSS stylesheet properties. Because the controls that I use
in the .ascx file do not list style as one of their properties (they list
CssClass, but but not a place where I can enter either a string or
property/value pairs). In the past when making pages I would type the Style=
attribute even though Visual Studio doesn't list it as an available
property. I have found the Style class and the
HtmlTextWriter.AddStyleAttribute method, but all the examples I have found
override Style.AddAttributesToRender and are in a non-ascx control (they are
not in controls that are built from existing controls). Could someone send
me a basic example of how to dynamically add style properties to an .ascx
user control? Thanks.
specify certain CSS stylesheet properties. Because the controls that I use
in the .ascx file do not list style as one of their properties (they list
CssClass, but but not a place where I can enter either a string or
property/value pairs). In the past when making pages I would type the Style=
attribute even though Visual Studio doesn't list it as an available
property. I have found the Style class and the
HtmlTextWriter.AddStyleAttribute method, but all the examples I have found
override Style.AddAttributesToRender and are in a non-ascx control (they are
not in controls that are built from existing controls). Could someone send
me a basic example of how to dynamically add style properties to an .ascx
user control? Thanks.