I have designed a custom user control, basically a button, that implements the IPostBackEventHandler
interface, and obviously defines the RaisePostBackEvent(string eventArgument)
method, where I do some processing, basically I trigger other events.
By default, when clicked my control will execute __doPostBack
its client id for a full page refresh, and of course RaisePostBackEvent is triggered.
However, I want to be able the use the control to refresh an update panel, so from client side I use the __doPostBack
method with the ID of the update panel and an additional argument.
The problem is that RaisePostBackEvent
is not triggered. I know i could look in Page.Request.Params["__EVENTARGUMENT"]
and do whatever I need, but I would really like something as simple and elegant as IPostBackEventHandler
so as to have all the logic in my control.
Long story short, how can I trigger RaisePostBackEvent
in case I have an asynchronous postback? Or is there another interface that with similar functionality?