user control event bubbling not working

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

hi guys I have a problem a event bubble that isn't working.

isn't working= I've opened up a handle in my user control but when I try to
use it ie.
ok I am trying to assign an event handler from Form1 to a user control's
event that I had previously made available.. but something's not right.
after the code is ran. The control does not see the BubbleClick event that
is assigned

bubblecontrol = new eventbubble();

this.bubblecontrol.BubbleClick += new EventHandler(form_bubleclick);

anyone know why ?

I've attached source code to
my user control
http://211.30.133.94:8000/WebApplication3/txt/eventbubble.txt
my form
http://211.30.133.94:8000/WebApplication3/txt/webform2.txt

thanks alot guys
Tom
 
Tom:

Remove this line from your aspx page:

bubblecontrol = new eventbubble();

You don't need to create a new control, ASP.NET will instantiate the
control and assign a reference to the bubblecontrol field for you. The
above will overwrite what ASP.NET does, and wires up an event to a
user control that does not render to the client.
 
thats not the problem...

if I don't initialise it I can't assign the event

it will throw null exception

Tom
 
Back
Top