Applying CSS to HTML Control Programatically


P

Prakash

I am using HTML controls in my page i want to Programatically apply CSS for
that controls as that of contorol.CSS="cssname" for Web Control. How to do
it?.

Thanks in Advance
Prakash.V
 
Ad

Advertisements

P

Prakash

Hi,
Only Web Control has Control.CssClass , but HTML Control doesn't have
that property.
Is there any method to set Css for HTML control Programatically ?

Prakash.V
 
K

Kevin Spencer

control.Attributes.Add("class", "yCssClass");

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.
 
M

Mr Newbie

I used to have a friend called Prakash.

I used to tease him that his name sounded like the Klingon name for a bowl
of live grubs!

I'm well known for my tact, dimplomacy, and the ease at which I seem to make
friends.

;-D
 
K

Kevin Spencer

I'm well known for my tact, dimplomacy, and the ease at which I seem to
make friends.

Yeah, me too. On the newsgroups I only show my "friendly" face.

:-O

--
;-)

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.
 
Ad

Advertisements

P

Prakash

Thanks Kevin Spencer,
control.Attributes.Add("class", "CssClassName");
Is working fine.

and also thanks Newbie for your comments,
and your name also sounds strange for me.I think u r a "Jolly Man".

mee too
;-))

Prakash.V
 

Top