Applying CSS to HTML Control Programatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Prakash

    Applying CSS to HTML Control Programatically

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

    Thanks in Advance
    Prakash.V


  • JuanCri

    #2
    Re: Applying CSS to HTML Control Programatically

    Hi...

    You could use

    control.CssClas s = "mycssclass ";

    Juan C. Olivares
    Writing stuff in English and Spanish


    Comment

    • Prakash

      #3
      Re: Applying CSS to HTML Control Programatically

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

      Prakash.V



      "JuanCri" <juancri@gmail. com> wrote in message
      news:1131450571 .978888.151410@ g49g2000cwa.goo glegroups.com.. .[color=blue]
      > Hi...
      >
      > You could use
      >
      > control.CssClas s = "mycssclass ";
      >
      > Juan C. Olivares
      > www.juancri.com
      >[/color]


      Comment

      • Kevin Spencer

        #4
        Re: Applying CSS to HTML Control Programatically

        control.Attribu tes.Add("class" , "yCssClass" );

        --
        HTH,

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

        "Prakash" <vvprakassh@gma il.com> wrote in message
        news:%23HGOz3F5 FHA.2816@tk2msf tngp13.phx.gbl. ..[color=blue]
        > Hi,
        > Only Web Control has Control.CssClas s , but HTML Control doesn't have
        > that property.
        > Is there any method to set Css for HTML control Programatically ?
        >
        > Prakash.V
        >
        >
        >
        > "JuanCri" <juancri@gmail. com> wrote in message
        > news:1131450571 .978888.151410@ g49g2000cwa.goo glegroups.com.. .[color=green]
        >> Hi...
        >>
        >> You could use
        >>
        >> control.CssClas s = "mycssclass ";
        >>
        >> Juan C. Olivares
        >> www.juancri.com
        >>[/color]
        >
        >[/color]


        Comment

        • Mr Newbie

          #5
          Re: Applying CSS to HTML Control Programatically

          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" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
          news:upLx7$F5FH A.4076@tk2msftn gp13.phx.gbl...[color=blue]
          > control.Attribu tes.Add("class" , "yCssClass" );
          >
          > --
          > HTH,
          >
          > Kevin Spencer
          > Microsoft MVP
          > .Net Developer
          > Complex things are made up of
          > Lots of simple things.
          >
          > "Prakash" <vvprakassh@gma il.com> wrote in message
          > news:%23HGOz3F5 FHA.2816@tk2msf tngp13.phx.gbl. ..[color=green]
          >> Hi,
          >> Only Web Control has Control.CssClas s , but HTML Control doesn't have
          >> that property.
          >> Is there any method to set Css for HTML control Programatically ?
          >>
          >> Prakash.V
          >>
          >>
          >>
          >> "JuanCri" <juancri@gmail. com> wrote in message
          >> news:1131450571 .978888.151410@ g49g2000cwa.goo glegroups.com.. .[color=darkred]
          >>> Hi...
          >>>
          >>> You could use
          >>>
          >>> control.CssClas s = "mycssclass ";
          >>>
          >>> Juan C. Olivares
          >>> www.juancri.com
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Kevin Spencer

            #6
            Re: Applying CSS to HTML Control Programatically

            > I'm well known for my tact, dimplomacy, and the ease at which I seem to[color=blue]
            > make friends.[/color]

            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" <here@now.com > wrote in message
            news:%23m2IO0G5 FHA.1148@tk2msf tngp13.phx.gbl. ..[color=blue]
            >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" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
            > news:upLx7$F5FH A.4076@tk2msftn gp13.phx.gbl...[color=green]
            >> control.Attribu tes.Add("class" , "yCssClass" );
            >>
            >> --
            >> HTH,
            >>
            >> Kevin Spencer
            >> Microsoft MVP
            >> .Net Developer
            >> Complex things are made up of
            >> Lots of simple things.
            >>
            >> "Prakash" <vvprakassh@gma il.com> wrote in message
            >> news:%23HGOz3F5 FHA.2816@tk2msf tngp13.phx.gbl. ..[color=darkred]
            >>> Hi,
            >>> Only Web Control has Control.CssClas s , but HTML Control doesn't have
            >>> that property.
            >>> Is there any method to set Css for HTML control Programatically ?
            >>>
            >>> Prakash.V
            >>>
            >>>
            >>>
            >>> "JuanCri" <juancri@gmail. com> wrote in message
            >>> news:1131450571 .978888.151410@ g49g2000cwa.goo glegroups.com.. .
            >>>> Hi...
            >>>>
            >>>> You could use
            >>>>
            >>>> control.CssClas s = "mycssclass ";
            >>>>
            >>>> Juan C. Olivares
            >>>> www.juancri.com
            >>>>
            >>>
            >>>[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Prakash

              #7
              Re: Applying CSS to HTML Control Programatically

              Thanks Kevin Spencer,
              control.Attribu tes.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" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
              news:Oz9VnCI5FH A.2676@TK2MSFTN GP15.phx.gbl...[color=blue][color=green]
              > > I'm well known for my tact, dimplomacy, and the ease at which I seem to
              > > make friends.[/color]
              >
              > 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" <here@now.com > wrote in message
              > news:%23m2IO0G5 FHA.1148@tk2msf tngp13.phx.gbl. ..[color=green]
              > >I used to have a friend called Prakash.
              > >
              > > I used to tease him that his name sounded like the Klingon name for a[/color][/color]
              bowl[color=blue][color=green]
              > > 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" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
              > > news:upLx7$F5FH A.4076@tk2msftn gp13.phx.gbl...[color=darkred]
              > >> control.Attribu tes.Add("class" , "yCssClass" );
              > >>
              > >> --
              > >> HTH,
              > >>
              > >> Kevin Spencer
              > >> Microsoft MVP
              > >> .Net Developer
              > >> Complex things are made up of
              > >> Lots of simple things.
              > >>
              > >> "Prakash" <vvprakassh@gma il.com> wrote in message
              > >> news:%23HGOz3F5 FHA.2816@tk2msf tngp13.phx.gbl. ..
              > >>> Hi,
              > >>> Only Web Control has Control.CssClas s , but HTML Control doesn't[/color][/color][/color]
              have[color=blue][color=green][color=darkred]
              > >>> that property.
              > >>> Is there any method to set Css for HTML control Programatically ?
              > >>>
              > >>> Prakash.V
              > >>>
              > >>>
              > >>>
              > >>> "JuanCri" <juancri@gmail. com> wrote in message
              > >>> news:1131450571 .978888.151410@ g49g2000cwa.goo glegroups.com.. .
              > >>>> Hi...
              > >>>>
              > >>>> You could use
              > >>>>
              > >>>> control.CssClas s = "mycssclass ";
              > >>>>
              > >>>> Juan C. Olivares
              > >>>> www.juancri.com
              > >>>>
              > >>>
              > >>>
              > >>
              > >>[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              Working...