How do I correct an XHTML validation warning?

I just recently had to reinstall VS 2010  (ASP .NET 4.0). i'm now getting a couple warnings that i don't remember getting before i had to do the reinstall. so i'm wondering if something got missed or if i'm missing a configuration setting or something.

I have a <div> (a couple actually) in a <asp:Content> tag and i keep getting a warning that reads:

"Validation (XHTML 1.0 Transitional): Element 'div' cannot be nested within element '<span>'"

what would cause this? I have another page with the same structure, in the same project, and i don't get the warning.
LVL 1
Michael SterlingWeb Applications DeveloperAsked:
Who is Participating?
 
Michel PlungjanIT ExpertCommented:
could it not also be a span OUTSIDE the content element that had not been closed

Show the generated html and we will be wiser
0
 
Dave BaldwinFixer of ProblemsCommented:
That is the warning you would get from the W3C validator if you had a <div> which is a block element inside a <span> which is an inline element.  Maybe something in the file has been corrupted?
0
 
Michael SterlingWeb Applications DeveloperAuthor Commented:
the markup looks like this: (roughly)
<asp:Content>
     <div>
     </div>
</asp:Content>
0
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.

 
Michael SterlingWeb Applications DeveloperAuthor Commented:
i don't remeber getting the warning before. but like i said, what's really odd is that i don't get it in other files in the site with the same markup sequence. so, i guess the file could've been corrupted.
0
 
Michael SterlingWeb Applications DeveloperAuthor Commented:
here is the generated HTML (see the attached code), for the span and the two DIVs that i'm being warned about...
<span>
                    
    <div class="mbsc-addAthlete-btn">

        <input type="submit" name="ctl00$HeaderContent$btnAthleteAdd" value="+ Add New Athlete" id="ctl00_HeaderContent_btnAthleteAdd" class="dl-add-new-button ui-corner-all" />
    </div>
    <div class="dl-command-bar ui-corner-all">
        Teams / Sport Filter:&nbsp;&nbsp;&nbsp;&nbsp;
        <select name="ctl00$HeaderContent$ddlTeams" onchange="javascript:setTimeout(&#39;__doPostBack(\&#39;ctl00$HeaderContent$ddlTeams\&#39;,\&#39;\&#39;)&#39;, 0)" id="ctl00_HeaderContent_ddlTeams">
	<option selected="selected" value="17">&lt;Choose Team...&gt;</option>
	<option value="1">Men&#39;s Baseball</option>

	<option value="2">Men&#39;s Basketball</option>
	<option value="3">Men&#39;s Cross Country</option>
	<option value="4">Men&#39;s Golf</option>
	<option value="5">Men&#39;s Soccer</option>
	<option value="6">Men&#39;s Tennis</option>

	<option value="7">Women&#39;s Basketball</option>
	<option value="8">Women&#39;s Cross Country</option>
	<option value="9">Women&#39;s Rowing</option>
	<option value="10">Women&#39;s Soccer</option>
	<option value="11">Women&#39;s Softball</option>

	<option value="12">Women&#39;s Tennis</option>
	<option value="13">Women&#39;s Crew</option>
	<option value="14">Women&#39;s Golf</option>
	<option value="15">Women&#39;s Volleyball</option>
	<option value="16">Dance Team</option>

	<option value="30">Wiffle Ball</option>
	<option value="31">Test Sport</option>
	<option value="32">Test Sport</option>
	<option value="33">Test Sport</option>
	<option value="34">Test Sport</option>
	<option value="35">Test Sport</option>

</select>
        
    </div>

                </span>

Open in new window

0
 
Michel PlungjanIT ExpertCommented:
So, the validator is correct

But why do you get a SPAN?

http://www.w3schools.com/aspnet/aspnet_masterpages.asp

has

<%@ Page MasterPageFile="master1.master" %>

<asp:Content ContentPlaceHolderId="CPH1" runat="server">
  <h2>Individual Content</h2>
  <p>Paragraph 1</p>
  <p>Paragraph 2</p>
</asp:Content>


which gives


<html>

<body>
<h1>Standard Header From Masterpage</h1>



<h2>Individual Content</h2>
<p>Paragrap 1</p>
<p>Paragrap 2</p>


</body>

</html>

http://www.w3schools.com/aspnet/mypage1.aspx

so I think you have an issue with the masterpage
0
 
Michael SterlingWeb Applications DeveloperAuthor Commented:
thanks for your help...
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.

All Courses

From novice to tech pro — start learning today.