Html – ASP.Net literal. Insert html

By | October 22, 2023

I have simple literal on my page.

<asp:Literal ID="litDescription" runat="server"></asp:Literal>

When I am trying to set the following text to the literal:

<p><div>Some Text</div></p>

in my browser’s markup I see

    <div>Some Text</div>

Why there are two ‘p’ tags? I need to have

<p><div>Some Text</div></p>.

Best Solution

A div inside a P is invalid HTML.
I don’t think .net is making the

I think it comes from your browser.

Category: Uncategorized