Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jeff #1
Inherited Control Does Not Handle All Events
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
Jeff Guest
-
resize control inherited from System.Web.UI.Control in design mode
How I can resize control inherited from System.Web.UI.Control in design mode. Thanks a lot. -
How to handle events of controls created at run time?
Hi, My application has two methods which creates buttons at runtime. In one method I am able to handle the events of the buttons created at run... -
How to add multiple buttons to a datagrid row... and handle their events
I have a DataTable that I'm currently displaying in a DataGrid... but I have the case where I need to use multiple buttons/linkButtons in each row of... -
Can we handle events for user controls
Can we handle events for user controls? If so how? Suppose we r creating a user control using a label can we handle a event for the user control... -
Question: Handle Events From Web User Controls
I was reading an article that talked about using the OnBubbleEvent overrides function to handle events from a web user control... -
GJH #2
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@gmail.com> wrote in message
news:1165257116.912044.4970@73g2000cwn.googlegroup s.com...> 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
>
GJH Guest
-
Jeff #3
Re: Inherited Control Does Not Handle All Events
I did not define the events or their handlers.
It almost seems like since the classes I am interested in are being
inherited from a class that doesnt explicitly define these events, that
they arent getting them. That doesnt really make sense to me though
since everything should be inherited across every level. I have tried:
Private Sub InsertButton_Click(ByVal sender As Object, ByVal e
As System.Web.UI.ImageClickEventArgs) Handles MyBase.Click
debugme() '<--- breakpoint here never hits
End Sub
with no luck. However, similar code in the BaseIconButton hits fine.
Again, I want to say that it seems like the second generation inherited
classes arent inheriting these events.
GJH wrote:> 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@gmail.com> wrote in message
> news:1165257116.912044.4970@73g2000cwn.googlegroup s.com...> > 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
> >Jeff Guest



Reply With Quote

