Re: Inherited Control Does Not Handle All Events



Did by chance you add the click Events in the class and leave them blank?

In your class file does something like this work?
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

Me.EnsureChildControls()

End Sub

Private Sub DeleteButton_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles MyBase.Click

Page.Response.Write("hi")

End Sub





"Jeff" <jeffmagill@xxxxxxxxx> wrote in message
news:1165257116.912044.4970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello everyone,

I'm building a series of custom controls inherited from an ImageButton
and certain events are never getting thrown, or at least their handlers
in the code are never running. Init, Load, DataBinding, PreRender and
Unload are all working fine. Click, Command and Dispose never get run.
Does anyone have any idea why this might be happening?

My basic hierarchy, should that be important, is as follows:

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Class BaseIconButton
Inherits ImageButton

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Class DeleteButton
Inherits BaseIconButton

Public Class InsertButton
Inherits BaseIconButton

Public Class EditButton
Inherits BaseIconButton

Public Class UpdateButton
Inherits BaseIconButton

Public Class CancelButton
Inherits BaseIconButton
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
It is the events for the second group of classes that I cannot capture.
If I test a BaseIconButton, then everything works perfectly.

Thanks



.


Loading