Is it possible to add an attribute to HtmlTextWriter WriteBreak

Posted by skyfoot on Stack Overflow See other posts from Stack Overflow or by skyfoot
Published on 2010-06-07T15:48:35Z Indexed on 2010/06/07 15:52 UTC
Read the original article Hit count: 207

Filed under:
|

Hi,

Is it possible to add a class to a br tag when using the HtmlTextWriter.WriteBreak method?

writer.AddAttribute(HtmlTextWriterAttribute.Class, "className");
writer.WriteBreak();

I need an xHtml compliant html output and therefore the WriteBreak is perfect as it writes

<br />

I want to add a class to the br so that I have

<br class="className" />

© Stack Overflow or respective owner

Related posts about c#

Related posts about htmltextwriter