I’m currently looking through some of my “dynamically generated” HTML and noticed this:
<div id="MainContent2_news"><span id="MainContent2_ctl00_newsLabel"><...
My C# looks like this:
<asp:Label ID="newsLabel" runat="server" />
Is there any way to change the SPAN to a DIV? I’m getting some ugly XHTML Validation errors.
A
spanis generated because it’s an inline asp element.If you want elements which do not generate any tag, use Literal or PlaceHolder.
If you want to have a
div-tag, use you can use the Panel or just do this<div class="someclass" runat="server" id="myDiv">Text</div>