Additive HtmlTextWriteStyle

J

Joris van Lier

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
 
J

Joris van Lier

Nevermind, just had my afternoon-dip....
styles.Add(HtmlTextWriterStyle.FontStyle, "bold");

should be

styles.Add(HtmlTextWriterStyle.FontWeight, "bold");
 
M

Munna

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top