Anyone have any idea when and why Page.OnLoad() executes twice in the ASP.NET lifecicle?
+4
A:
Do you have a an IMAGE element with a blank string for the URL on that page?
This one has caught so many people before :)
leppie
2009-03-04 10:47:13
Funny I posted the same Question a while back and yes <img src=""> was the culprit !
The_AlienCoder
2010-03-26 14:43:30
+1
A:
Do you have AutoEventWireUp
set to true
and also attaching an event handler in code? This is a common reason.
Mehrdad Afshari
2009-03-04 10:49:15
+2
A:
Make sure you don't have any tags like <img src="#"> or <img src="">, that makes IIS load the page twice. It's a classic.
axel_c
2009-03-04 10:50:22
A:
Do you have any controls with AutoPostBack set to true ? That will cause the Page object to be recreated and therefore the PageLoad method will execute again.
Dominic
2009-03-04 10:53:19