Render HTML5 with Razor

1

According to W3Schools an input does not have ex tag closing

<input type="text" name="firstname" value="Mickey">

source: link

In my ASP.NET MVC project I have the following command

@Html.TextBoxFor(model => model.Erro, new { @class = "form-control" })

The rendering result is

<input class="form-control" id="Erro" name="Erro" type="text" value="" />

Should not the result be as below?

<input class="form-control" id="Erro" name="Erro" type="text" value="">

Is there any configuration to be made in ASP.NET, update, anything to render according to HTML5?

    
asked by anonymous 10.03.2016 / 21:01

1 answer

5

According to W3Schools itself :

  

In HTML, the <input> tag has no end tag.

     

In XHTML, the <input> tag must be properly closed, like this <input /> .

HTML5 follows the XHTML standard rather than HTML (4). That is, it is correct.

    
10.03.2016 / 21:11