Sam,
Thanks for all the help. I will remove IPostBackEventHandler code,
since I don't need to raise any events.
I implemented the Oninit() override, but I couldn't get that id. It
was returning null.
It turns out that my problems were elsewhere, however. I had another
control on the page that prevented the postback altogether. Once I
removed it, the event worked like a charm :)
Thanks,
J
[quoted text, click to view] sam wrote:
> You don't need to do all that implement interface stuff with the button
> you wrote. Just erase all of it.
>
> What you have should work unless I'm missing something. Assign IDs to
> all of the controls on the way to hooking up the button (you can skip
> this step if you want to for now). Put a breakpoint in OnInit (you
> *are* calling EnsureChildControls() here arent' you?). Look at
> Page.Request.Form["__EVENTTARGET"]. It should equal
> "this.submitButton.UniqueID". Tell me what you get.
>
> -Sam
__EVENTTARGET is populated for controls not able to post without calling
__doPostBack. E.g essentially Button and ImageButton won't populate it but
LinkButton would as it uses __doPostBack.
But yes, if handling an event defined by a subcontrol, you don't need to
implement any interface in the composite control itself. Just having the
event handler wired, is enough.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke [quoted text, click to view] "sam" <samuelrobertson@gmail.com> wrote in message
news:1150507311.508951.318640@f6g2000cwb.googlegroups.com...
> You don't need to do all that implement interface stuff with the button
> you wrote. Just erase all of it.
>
> What you have should work unless I'm missing something. Assign IDs to
> all of the controls on the way to hooking up the button (you can skip
> this step if you want to for now). Put a breakpoint in OnInit (you
> *are* calling EnsureChildControls() here arent' you?). Look at
> Page.Request.Form["__EVENTTARGET"]. It should equal
> "this.submitButton.UniqueID". Tell me what you get.
>
> -Sam
>