Style Sheet CLASS

  • Thread starter Thread starter A.M
  • Start date Start date
A

A.M

Hi,

How can I change the CLASS property of a server control inside code behin's
Page_Load event?

I can see the class property in Properties window, but I don't have "class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali
 
I am working with "System.Web.UI.HtmlControls.HtmlTableCell" server side
control which doesn't have CssClass property!!
 
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?
 
Why not just use a regular table and give the particular cell and ID? Then
you can access the <TD>'s style property directly?
 
It has an Attributes Collection, to which you can add any HTML attribute you
want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Thanks Kevin!

Kevin Spencer said:
It has an Attributes Collection, to which you can add any HTML attribute you
want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top