Class attribute with asp controls

  • Thread starter Thread starter E. Zackatackali
  • Start date Start date
E

E. Zackatackali

Hello,

Is it possible to use the class attribute with asp:XXX controls? I notice
that when I try to do this (so that I can use stylesheets with these
controls), Visual Studio reports an error that there is no such attribute as
class.

Thanks,

EZ
 
It is called CssClass
and can be used such like MyTextBox.CssClass = "class1" or
MyTextBox.CssClass = "class1 class2"

or
<asp:TextBox Runat="Server" CssClass="class1" Id="MyTextBox" />
 
Hello,

Is it possible to use the class attribute with asp:XXX controls? I notice
that when I try to do this (so that I can use stylesheets with these
controls), Visual Studio reports an error that there is no such attribute as
class.

Thanks,

EZ

In asp.net webcontrols, it's called CssClass, and whether or not it
exists depends on the control.

But if you're using VS.NET, then you could have figured this out
using the Properties box.

-- ipgrunt
 
Back
Top