I have an ASP.NET website that is not passing the W3C XHTML validation.
It doesn't pass validation because I place <div>
content into a <asp:Label>
, and so the resulting markup looks like:
<span><div>stackoverflow</div></span> <!-- INVALID; DIV INSIDE SPAN -->
However, after replacing all my <asp:Label>
with <asp:Literal>
, I get errors that <asp:Literal>
cannot be nested inside another <asp:Literal>
.
I don't really understand how I'm suppose to be solving this, since <asp:Literal>
sounds like it would have otherwise been exactly what I wanted.
Is the correct solution to use <asp:PlaceHolder>
?