Hi Steve,
There are few resolutions to the problem:
1. Depending on the browser caps you will get <bror <br/>
public class HtmlBr : System.Web.UI.HtmlControls.HtmlControl
{
protected override void Render(HtmlTextWriter writer)
{
writer.WriteBreak();
}
}
2. Insetad of deriving simply use LiteralControl
rendring for HTML 4.0
myContainer.Controls.Add(new LiteralControl("<br>"));
or for XHTML 1.0/1.1
myContainer.Controls.Add(new LiteralControl("<br/>"));
Please note you and Mark are both right because you're talking abount HTML
4.01 standard (<br>) and Mark is talking about XHTML <br/(all tags must be
valid from XML point of view)
Regards
Milosz
--
Milosz
"Steve Richter" wrote:
I am using HtmlGenericControl to render html tags like <divand
<span>.
the problem is the <brtag does not render correctly when I use this
method. ( it renders as <br></br>, which is seen by the browser as 2
consecutive <brtags.
public class Html_br : HtmlGenericControl
{
public Html_br()
: base("br")
{
}
}
How can I render the <brtag so that I can use Controls.Add to add a
<brtag to the output of my user control?
thanks,
-Steve