|
|
 |
 |
 |
 |
CssClass
Hello, On a class I am defining the CssClass of a control at runtime. However, I would also like to create the CssClass at runtime. Is this possible? Something like: Dim myCssClass="clear:both; color: #FFFFFF" MyControl.CssClass = myCssClass Thanks, Miguel
CssClass is the html class attribute and should be the name of a style class, not a style command. you can render the style commands at runtime. -- bruce (sqlwork.com)
shapper wrote: > Hello, > On a class I am defining the CssClass of a control at runtime. > However, I would also like to create the CssClass at runtime. Is this > possible? > Something like: > Dim myCssClass="clear:both; color: #FFFFFF" > MyControl.CssClass = myCssClass > Thanks, > Miguel
Sure: Dim myCssClassName As String ="myCSS" Dim myCssClassDefinition As String = "clear:both; color: #FFFFFF" Dim ltrl As Literal = New Literal ltrl.Text = String.Format("<{0} type='text/css'>.{1} {{{2}}}</{0}>", "style", myCssClassName , myCssClassDefinition) Me.Page.Header.Controls.Add(ltrl) ' and then assign your class to controls: MyControl.CssClass = myCssClassName
"shapper" wrote: > Hello, > On a class I am defining the CssClass of a control at runtime. > However, I would also like to create the CssClass at runtime. Is this > possible? > Something like: > Dim myCssClass="clear:both; color: #FFFFFF" > MyControl.CssClass = myCssClass > Thanks, > Miguel
On May 29, 11:50 pm, shapper <mdmo @gmail.com> wrote: > Hello, > On a class I am defining the CssClass of a control at runtime. > However, I would also like to create the CssClass at runtime. Is this > possible? > Something like: > Dim myCssClass="clear:both; color: #FFFFFF" > MyControl.CssClass = myCssClass > Thanks, > Miguel
http://groups.google.com/group/microsoft.public.dotnet.framework.aspn...
|
 |
 |
 |
 |
|