Request.Form["__EVENTTARGET"] for the controls that postback with javascript
calls. It will return an empty string if the postback was fired by a button
or an imagebutton. You can either iterate through the Form Keys collection
or try to find there by the button/imagebutton id.
One place to look is in the Page_Load event, but I would be careful about
creating code trees in this event, as you can end up with some funky stuff
if you try to make all of your decisions here.