Another issue hit me today and spent some time debugging it. As the title says my control events all launched twice. This caused problems to my code logic and also it is an unnecessary performance hit to do something twice when one rendering pass is what is enough.
The problem was due to the <asp:image control inside my SharePoint 2010 Visual Webpart. For some reason(I’m gonna say a bug in MS code, it seems like it) if you did not set the image URL of the control while it is created OR defined(lets say on the ASCX side my webpart) you will suffer from double loading.
Of course this did not solve my problem entirely until I decided to ditch the <asp:image control and replace it with a HTML server side control <img. NOTICE that I still had to set the img src attribute to some location while defining the control.
Example of the control definition:
<img src=”#” id=”iBlogImage” runat = “server”/>