Capture child event in parent

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
 
C

Cowboy \(Gregory A. Beamer\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top