Encountered end tag "nav" with no matching start tag

 
0
 

I keep getting this error

Parser Error Message: Encountered end tag "nav" with no matching start tag.  Are your start/end tags properly balanced?


Source Error:

Line 110:                         </li>
Line 111:                         </ul>
Line 112:                 </nav>
Line 113:            }    
Line 114:       </div>

My code is fairly simple (using Webmatrix with Razor)

@if (WebSecurity.IsAuthenticated) {     
      <nav>
        <ul>
            
            <li id="login">
                <a id="login-trigger" href="#">
                                        <span id="user-panel-check"></span>
               
                                        <span id="user-panel-title">Welcome, <strong>@WebSecurity.CurrentUserName</strong></span>
                
                    <span id="user-panel"></span>
                </a>
                <div id="login-content">
                  <ul>
                  <li><a href="#"><span>Settings</span> <img src="./images/setting.png" alt=""></a></li>
                  <li><a href="#"><span>Help</span> <img src="./images/help.png" alt=""></a></li>
                  <li><a href="./index.html"><span>Log Out</span> <img src="./images/logout.png" alt=""></a></li>
                  </ul>
               </div>                       
            </li> 
            
        </ul>
      </nav> 
          } else {
                 <nav>
                     <ul>
            
                     <li id="login">
                <a id="login-trigger" href="#">
                                        <span id="user-panel-check"></span>
               
                                        <span id="user-panel-title">Login</strong></span>
                
                    <span id="user-panel"></span>
                </a>   
                         </li>
                         </ul>
                 </nav>
            }

Please advise.

 
0
 

Why don't you put this outside of the if statement:

<nav>
<ul>
...
</ul>
</nav>

This doesn't say why it's happening, however it will get rid of some redundancy.

 
0
 

On line 32 you have a closing </strong> tag without an opening one. That might have something to do with it?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article