Asp.net incorrectly closing meta tag in html 4.01

My project is an asp.net-mvc 2 project using the default web form viewer.

In the main tag, the home page contains the following:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

      

This is valid Html 4.01 and should not contain a trailing self-closing tag (it is not xhtml).

If I run this page, it displays like this:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

      

What am I doing wrong?

+1


source to share


1 answer


Reflector will indicate that this is by design and not committing ... unless you are EnableLegacyRendering (which I have no experience with so there is).



protected internal override void Render(HtmlTextWriter writer)
{
    if (base.EnableLegacyRendering)
    {
        base.Render(writer);
    }
    else
    {
        writer.WriteBeginTag(this.TagName);
        this.RenderAttributes(writer);
        writer.Write(" />");
    }
}

      

+1


source







All Articles