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 responses to “XML Parsing Error: no element found”

  1. Pulkit Avatar

    where exactly did you add this code?

  2. vivikas- Avatar

    Response.ContentType = “text/HTML
    where to add the above code?

    1. Jitendra Zaa Avatar

      Add this code in C# class behinf ASPX page

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading