Tuesday 21 July 2009

ASP.NET Web Forms – Page Loading Twice

Here’s an obscure bug, I had a page that was loading twice and I had no idea why.  Most internet answers just say “Turn AutoEventWireup to false” without understanding why it might legitimately be set to true or even trying to understand why it could or should be set to true, it’s VERY frustrating.  Well I did finally find out why it does this.

Far as I can tell it’s a bug, but there might be a very good reason behind it that I just don’t know or understand.  If you have an image with an SRC attribute set to “” then the page MAY load twice.  Sounds ridiculous right?

Well this:

   1: <img src=""/>
Will force your page to load twice.  It’s a very bizarre way of handling it.

No comments: