By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,705 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,705 IT Pros & Developers. It's quick & easy.

ImageButton click event and composite control

P: n/a
Hi, I am trying to capture the click event of an ImageButton that exists in
a composite server control that I am building.

I create the imagebutton in the CreateChildControls routine

[vbcode]
' Create the button
Dim imgButton as New ImageButton
' Add click event handler
AddHandler imgButton.Click, AddressOf OnSend
I then add the control to the controls collection....
Me.Controls.Add(imgButton)
[/vbcode]

When I view the page the imagebutton displays correctly but whenever I click
it the event is not raised. My OnSend routine is below
[vbcode]
Protected Overridable Sub OnSend(ByVal sender As Object, ByVal e As
ImageClickEventArgs)
Me.Parent.Page.Response.Redirect("http://www.microsoft.com")
End Sub
[/vbcode]

I am also implementing the INamingContainer to create distinct names. Any
ideas welcomed :)
Thanks
Mark
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.