Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Applying CSS to HTML Control Programatically

Reply
Thread Tools

Applying CSS to HTML Control Programatically

 
 
Prakash
Guest
Posts: n/a
 
      11-08-2005
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


 
Reply With Quote
 
 
 
 
JuanCri
Guest
Posts: n/a
 
      11-08-2005
Hi...

You could use

control.CssClass = "mycssclass";

Juan C. Olivares
www.juancri.com

 
Reply With Quote
 
 
 
 
Prakash
Guest
Posts: n/a
 
      11-08-2005
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



"JuanCri" <> wrote in message
news: oups.com...
> Hi...
>
> You could use
>
> control.CssClass = "mycssclass";
>
> Juan C. Olivares
> www.juancri.com
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      11-08-2005
control.Attributes.Add("class", "yCssClass");

--
HTH,

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

"Prakash" <> wrote in message
news:%...
> 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
>
>
>
> "JuanCri" <> wrote in message
> news: oups.com...
>> Hi...
>>
>> You could use
>>
>> control.CssClass = "mycssclass";
>>
>> Juan C. Olivares
>> www.juancri.com
>>

>
>



 
Reply With Quote
 
Mr Newbie
Guest
Posts: n/a
 
      11-08-2005
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

--
Best Regards

The Inimitable Mr Newbie º¿º



"Kevin Spencer" <> wrote in message
news:upLx7$...
> control.Attributes.Add("class", "yCssClass");
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Complex things are made up of
> Lots of simple things.
>
> "Prakash" <> wrote in message
> news:%...
>> 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
>>
>>
>>
>> "JuanCri" <> wrote in message
>> news: oups.com...
>>> Hi...
>>>
>>> You could use
>>>
>>> control.CssClass = "mycssclass";
>>>
>>> Juan C. Olivares
>>> www.juancri.com
>>>

>>
>>

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      11-08-2005
> 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.

"Mr Newbie" <> wrote in message
news:%...
>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
>
> --
> Best Regards
>
> The Inimitable Mr Newbie º¿º
>
>
>
> "Kevin Spencer" <> wrote in message
> news:upLx7$...
>> control.Attributes.Add("class", "yCssClass");
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Complex things are made up of
>> Lots of simple things.
>>
>> "Prakash" <> wrote in message
>> news:%...
>>> 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
>>>
>>>
>>>
>>> "JuanCri" <> wrote in message
>>> news: oups.com...
>>>> Hi...
>>>>
>>>> You could use
>>>>
>>>> control.CssClass = "mycssclass";
>>>>
>>>> Juan C. Olivares
>>>> www.juancri.com
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Prakash
Guest
Posts: n/a
 
      11-09-2005
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

"Kevin Spencer" <> wrote in message
news:...
> > 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.
>
> "Mr Newbie" <> wrote in message
> news:%...
> >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
> >
> > --
> > Best Regards
> >
> > The Inimitable Mr Newbie º¿º
> >
> >
> >
> > "Kevin Spencer" <> wrote in message
> > news:upLx7$...
> >> control.Attributes.Add("class", "yCssClass");
> >>
> >> --
> >> HTH,
> >>
> >> Kevin Spencer
> >> Microsoft MVP
> >> .Net Developer
> >> Complex things are made up of
> >> Lots of simple things.
> >>
> >> "Prakash" <> wrote in message
> >> news:%...
> >>> 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
> >>>
> >>>
> >>>
> >>> "JuanCri" <> wrote in message
> >>> news: oups.com...
> >>>> Hi...
> >>>>
> >>>> You could use
> >>>>
> >>>> control.CssClass = "mycssclass";
> >>>>
> >>>> Juan C. Olivares
> >>>> www.juancri.com
> >>>>
> >>>
> >>>
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying Css on input button Von Shean HTML 4 06-22-2010 07:08 AM
applying css formats to asp.net 2.0 treeview control schneider@rehm.de ASP .Net 0 03-19-2007 01:26 PM
Applying CSS Styles to Dropdownlist =?Utf-8?B?TmVpbCBTdGV2ZW50b24=?= ASP .Net 4 05-15-2006 02:16 PM
confused - html validates, css validates but validate css from the html causes errors Titus A Ducksass - AKA broken-record HTML 6 11-15-2004 12:59 PM
CSS: Span not applying text-color attribute Noozer HTML 2 09-26-2004 04:28 PM



Advertisments