smart1:Why on earth would this happen, and what is a work around?
If we follow the steps you outlined in your first post, here is the resulting HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUKMTk3MzY5NzU2NmRkcyJx3K2nk5TStoXXq40WY7ygMOg=" />
</div>
<div>
<img id="Image1" src="" style="border-width:0px;" /></div>
</form>
</body>
</html>
What is important to note is that the src attribute of the <img> tag is an empty string. So, what image file does the browser request? Well, whenever a browser comes across an empty address for a file it must request, it substitutes the document's own address. (There is one exception that is not relevant here.) This is why a postback will work even if there is no action parameter--the form will be posted back to the document's own address.
So, let's consider what happens when there is a break-point in the Page_Load of default.aspx.
The browser issues a request for default.aspx, and the break-point in the Page_Load is caught. We expect this. Then the rest of the page renders and is returned to the browser.
Now, the browser sees that there is an <img> tag, so it must request an image. What does it request? It requests an image at default.aspx. So, the browser issues a second request for default.aspx, and the break-point in the Page_Load is caught again.
So, it is not that the same break-point is being hit two times during a single request. Rather, the application is receiving two separate requests for the same default.aspx. (If you dove down into the details of each request as shown in the debugger, you could probably find proof that the requests are separate and different. But frankly, I wouldn't know where to look.)
As proof that this is what is occuring, you can remove the <img> tag, and instead use Flash <object> element that also contains an empty source address. Or you can use a <script> element with an empty src attribute. In each case, the browser will substitute default.aspx for the missing address, and again it will show that the Page_Load break-point is being hit twice.
That then is why your break-point is being hit twice--it is receiving two separate requests for the same .aspx document.
This also explains why, when you give the <asp:Image> control a non-empty ImageUrl property, the break-point will not be hit twice. There is no longer a second request for an image located at default.aspx.
This also explains why Terri and NC01 did not see two hits to Page_Load when they turned on tracing for the page. The Page_Load is hit once for default.aspx, and they see the trace output. But then there is a second request made for the empty <img> tag, which will not show up on the trace output.
I hope this helps you.