Style Sheet CLASS

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
 
A

A.M

I am working with "System.Web.UI.HtmlControls.HtmlTableCell" server side
control which doesn't have CssClass property!!
 
A

A.M

System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?
 
S

Scott M.

Why not just use a regular table and give the particular cell and ID? Then
you can access the <TD>'s style property directly?
 
K

Kevin Spencer

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.
 
A

A.M

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top