ASP.NET XML Parsing Error: no element found Line Number 1, Column 1 Error

后端 未结 12 2391
[愿得一人]
[愿得一人] 2021-02-20 05:44

Hey I found a weird temperamental page which randomly gives me the following error

XML Parsing Error: no element found
Location: http://kj2011/site_2011/nonprofit-data         


        
12条回答
  •  眼角桃花
    2021-02-20 05:50

    I just debugged this issue on my website. In my case, the cause was a call to Response.End() . You can recreate the error by dropping Response.End() as the first line of Page_Load.

    From MSDN ms524629:

    The Response.End method causes the Web server to stop processing the script and return the current result. The remaining contents of the file are not processed.

    In my case, Response.End() was being called before any content was written to the buffer. Also, there was no Content-Type in the response header (see attached Firebug screen grabs). My guess is because of these two factors, Firefox didn't know what to make of it and by default it tried to process it as a an XML file.

    In your situation, my guess is the extra View.aspx file caused an exception that was interrupting page rendering cycle.

    http://i.stack.imgur.com/wpLrt.png

    http://i.stack.imgur.com/LE59C.png

提交回复
热议问题