Additive HtmlTextWriteStyle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joris van Lier

    Additive HtmlTextWriteStyle

    I'm looking to add Additive Styles to a CssStyleCollect ion, however the
    Add(HtmlTextWri teStyle, String) method seems to replace styles (see example
    below).
    void Style(CssStyleC ollection styles)
    {
    styles.Add(Html TextWriterStyle .FontStyle, "italic");
    styles.Add(Html TextWriterStyle .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

    #2
    Re: Additive HtmlTextWriteSt yle

    "Joris van Lier" <whizzrd@hotmai l.comwrote in message
    news:2E2D8511-24CE-44F7-872A-28DD1F54BA15@mi crosoft.com...
    Nevermind, just had my afternoon-dip....
    styles.Add(Html TextWriterStyle .FontStyle, "bold");
    should be

    styles.Add(Html TextWriterStyle .FontWeight, "bold");


    Comment

    • Munna

      #3
      Re: Additive HtmlTextWriteSt yle



      Hi

      First of all you are trying to add multiple style with same key...
      that is HtmlTextWriterS tyle.FontStyle
      if you want to use bold as style try
      "HtmlTextWriter Style.FontWeigh t" enum value...

      Thanks & best of luck

      Munna



      Comment

      Working...