My project is an asp.net开发者_StackOverflow-mvc 2 project using the default webforms view engine.
The master page contains the following in the head tag:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
This is valid Html 4.01 and shouldn't contain a trailing self-closing tag (it's not xhtml).
When I run this page however, it gets rendered as follows:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
What am I doing wrong?
Reflector would indicate that this is by design and not to be fixed ... unless you EnableLegacyRendering (which I have no experience with so there's that).
protected internal override void Render(HtmlTextWriter writer)
{
if (base.EnableLegacyRendering)
{
base.Render(writer);
}
else
{
writer.WriteBeginTag(this.TagName);
this.RenderAttributes(writer);
writer.Write(" />");
}
}
精彩评论