Capture child event in parent

  • Thread starter Thread starter Weblancer
  • Start date Start date
W

Weblancer

I have got a task and i would like to know ways how it could be done.
I have got .aspx file and it includes user control (ascx)
i want to do that after clicking edit button in user control tabs in
parent(aspx) become disabled.
i tryed to do it by putting value into hidden field under usercontrol
and make public to read from it but it does not work because first
loads prent after it loads child and only than button_click happens
and parent does not know that edit button was clicked before second
forced refreash.

Please help me to sort this somehow
 
This is the simplest method I can think of right now.

In ASCX, let's examine C# (just because the solution I am copying from is
C#).

//Create Event handler
public event EventHandler RegisterCustomer;

//Send event
//Sender and e can be nulled or resent from the event handler
//on the ASCX
RegisterCustomer(sender, e);


In ASPX, I have VB (yes, the solution was built by two people, part C#, part
VB)

Protected Sub RegisterUnit1_BubbleUpRegister(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Register.RegisterCustomer

'Code for registration

End Sub


In C#, you would wire the event handler instead using the delegate wiring
method. I do not have a bit of code I can quickly copy.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top