Additive HtmlTextWriteStyle

Discussion in 'ASP .Net' started by Joris van Lier, May 28, 2008.

  1. I'm looking to add Additive Styles to a CssStyleCollection, however the
    Add(HtmlTextWriteStyle, String) method seems to replace styles (see example
    below).
    void Style(CssStyleCollection styles)
    {
    styles.Add(HtmlTextWriterStyle.FontStyle, "italic");
    styles.Add(HtmlTextWriterStyle.FontStyle, "bold");
    // now expecting Italic + Bold
    // however styles.Value == "font-style:bold;"
    }

    How do I assign styles in an additive way?


    Thanks

    Joris
     
    Joris van Lier, May 28, 2008
    #1
    1. Advertising

  2. "Joris van Lier" <> wrote in message
    news:...
    Nevermind, just had my afternoon-dip....

    > styles.Add(HtmlTextWriterStyle.FontStyle, "bold");


    should be

    styles.Add(HtmlTextWriterStyle.FontWeight, "bold");
     
    Joris van Lier, May 28, 2008
    #2
    1. Advertising

  3. Joris van Lier

    Munna Guest

    Hi

    First of all you are trying to add multiple style with same key...
    that is HtmlTextWriterStyle.FontStyle
    if you want to use bold as style try
    "HtmlTextWriterStyle.FontWeight" enum value...

    Thanks & best of luck

    Munna

    www.munna.shatkotha.com
     
    Munna, May 28, 2008
    #3
    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. Chris Vendel
    Replies:
    5
    Views:
    455
    Jesse Hager
    Jun 4, 2004
  2. Chris Vendel
    Replies:
    0
    Views:
    394
    Chris Vendel
    Jun 3, 2004
  3. Mesvak
    Replies:
    1
    Views:
    714
    Daniel Pitts
    Aug 27, 2008
Loading...

Share This Page