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.
Leave a Reply