0

Am I missing something here?

If I try to validate the basic HTML5 masterpage template of a new basic MVC 4 project, it doesn't validate. What is wrong?

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>

    @RenderBody()

    @Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)


</body>
</html>

both this validator: http://html5.validator.nu/ and the w3 one give the same errors:

Error: Stray end tag head.
From line 9, column 1; to line 9, column 7
dernizr")↩↩ Error: An body start tag seen but an element of the same type was already open.
From line 10, column 1; to line 10, column 6
)↩↩↩ ↩

1 Answer 1

2

You are validating against the raw Razor source, which is intended to be interpreted by the web server, not a web browser. You should validate against the generated HTML.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.