XML Parsing Error: no element found

Author posted by Jitendra on Posted on under category Categories ASP.NET, Tech Tips and tagged as Tags , with 3 Comments on XML Parsing Error: no element found

Few Days ago, i found strange error like “XML Parsing Error: no element found“.

I was unable to find the exact root cause. Most of the times it happens if you are missing any closing tag in your ASPZ application. I checked my complete page and reconfirmed but error still persist.

somehow i found that ASP.NET treat the response of page as XML document and that’s why we receive XML Parsing Error: no element found error.

so explicitly i set the response type of my page as text/HTML. Response.ContentType = “text/HTML”.

And this line tells the ASPX that page is HTML, not XML.

Related posts

3 thoughts on “XML Parsing Error: no element found”

Leave a Reply

Your email address will not be published. Required fields are marked *