Here are some background infos for this question: Where to load data in the lifecycle of custom webpart
Having a webpart with different controls (buttons, dropdownlist etc.), I want to check, if a postback was made by a control of my custom webpart.
I want to check that in CreateChildControls, where I initially load the data for my webpart.
If the postback happens and it came from my webpart, I don't want to load the data in CreateChildControls, because that happens in the HandleClickEvents method (with different parameters delivered from the sender object).
BUT: if the postback came from another webpart, I have to load initial data in CreateChildControls, to show the initial state.
There is a way to check which control sent the postback with:
Page.Request.Params.Get("__EVENTTARGET");
But that doesn't work for ImageButtons.
Is there a way which works for all kinds of controls?