• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

ASP.net 2010 Error "Validation (HTML5): Element 'nav' cannot be be nested within element 'html'"

Hi

I am trying to learn a bit of html5. I created a new ASP.net web application the I changed the Text validation in
Tools/Options/Text Editor/HTML from "XHTML 1.0 Transitional" to "HTML5".
I get the following error in the mark up further down. Have I set this up wrong? I realise that I am shooting in the dark a bit here.

Error: "Validation (HTML5): Element 'nav' cannot be be nested within element 'html'"

My page's mark up code:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="HTML5._Default" %>

<!DOCTYPE html>
<html lang="en">  
  <head>    
    <meta charset="utf-8">    
    <title>My Title</title>  
  </head>  
  <nav>
  <ul>
    <li><a href="Default.aspx">Home</a></li>
    <li><a href="Webform1.aspx">Page 1</a></li>
    <li><a href="Webform2.aspx">Page 2</a></li>
  </ul>
</nav>
  <body>

         <!--shorten the link if you are not changing servers-->
     <a href="Webform1.aspx">Page 1</a>

  </body>
</html>
0
Murray Brown
Asked:
Murray Brown
  • 2
2 Solutions
 
Lokesh B RDeveloperCommented:
Hi,

You need this update - Web Standards Update for Visual Studio 2010 SP1

Check the below links for HTML5 elements support on VS 2010

http://blogs.msdn.com/b/webdev/archive/2011/06/15/web-standards-update-for-visual-studio-2010-sp1.aspx?PageIndex=2

https://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
0
 
Carl TawnSystems and Integration DeveloperCommented:
The nav element is valid, but it still needs to live inside the body element, rather than outside it like you currently have it.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now