it is because nothing actually calls your custom OnClick method (it is the
original OnClick called at IPostBackEventHandler.RaisePostBackEvent
implementation of base ImageButton). Easier would be just overriding the
OnClick method base class provides and from there raise this custom event,
without calling base class method when original Click event is not raised,
but this certainly depends what you want to do.

Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Troy" <anonymousdiscussions.microsoft.com> wrote in message
I have a custom control that inherits from ImageButton. When I click the
button it does not fire. Any ideas? Here's what I have as of now:

Public Class myNavEventArgs
Inherits EventArgs

....some properties.

End Class

<Serializable(), ToolboxData("<{0}:myImageButton
runat=server></{0}:myImageButton>")> Public Class myImageButton
Inherits System.Web.UI.WebControls.ImageButton
Implements ISerializable

Public Shadows Event Click(ByVal sender As Object, ByVal e As

Protected Shadows Sub OnClick(ByVal e As myNavEventArgs)

RaiseEvent Click(Me, e)

End Sub

End Class

Thanks for all your help.