Programmatically Applying Style Sheets....

Discussion in 'ASP .Net' started by soulcode, May 8, 2004.

  1. soulcode

    soulcode Guest

    Hi Guys,

    Does anyone know of an easy way of doing this...

    ****************** ASP.NET/VB.NET *********************
    With MenuSystem.MenuHeaderStyle.Style
    .Add("font-family", "verdana")
    .Add("font-size", "70%")
    .Add("height", "15px")
    .Add("background", "#9999ff")
    .Add("border", "0px solid gray")
    .Add("padding-left", "20px")
    .Add("padding-Top", "7px")
    .Add("padding-Bottom", "7px")
    .Add("padding-Right", "20px")
    .Add("cursor", "hand")
    .Add("border-top", "0px solid black")
    .Add("font-align", "center")
    End With
    *******************************************************

    I'm dynamically creating user controls that contain web controls which
    are also created dynamically. Creating controls this way kindof made
    things really complecated and the only way I could apply styles to them
    was to programmatically do it (above). Is there a way that i could
    somehow map a stylesheet element through code?

    Let me know if you need further clarification.

    Cheers,

    Soulcode.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    soulcode, May 8, 2004
    #1
    1. Advertising

  2. YourControl.Attributes.Add("style", "font-family:verdana; ...");

    -Jason

    soulcode wrote:
    > Hi Guys,
    >
    > Does anyone know of an easy way of doing this...
    >
    > ****************** ASP.NET/VB.NET *********************
    > With MenuSystem.MenuHeaderStyle.Style
    > .Add("font-family", "verdana")
    > .Add("font-size", "70%")
    > .Add("height", "15px")
    > .Add("background", "#9999ff")
    > .Add("border", "0px solid gray")
    > .Add("padding-left", "20px")
    > .Add("padding-Top", "7px")
    > .Add("padding-Bottom", "7px")
    > .Add("padding-Right", "20px")
    > .Add("cursor", "hand")
    > .Add("border-top", "0px solid black")
    > .Add("font-align", "center")
    > End With
    > *******************************************************
    >
    > I'm dynamically creating user controls that contain web controls which
    > are also created dynamically. Creating controls this way kindof made
    > things really complecated and the only way I could apply styles to them
    > was to programmatically do it (above). Is there a way that i could
    > somehow map a stylesheet element through code?
    >
    > Let me know if you need further clarification.
    >
    > Cheers,
    >
    > Soulcode.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Jason DeFontes, May 8, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    2
    Views:
    489
    nicholas
    Dec 16, 2004
  2. Replies:
    1
    Views:
    813
    Bertilo Wennergren
    Nov 24, 2003
  3. iamdave

    applying external style sheets

    iamdave, Jan 25, 2008, in forum: HTML
    Replies:
    5
    Views:
    485
    Adrienne Boswell
    Jan 26, 2008
  4. Carl Corcoran
    Replies:
    1
    Views:
    290
    Bob Barrows
    Nov 12, 2003
  5. Jake Barnes
    Replies:
    6
    Views:
    215
    Lawrence Krubner
    Apr 12, 2009
Loading...

Share This Page