Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Capture child event in parent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Weblancer - 26 Oct 2007 13:43 GMT
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
Cowboy (Gregory A. Beamer) - 26 Oct 2007 16:14 GMT
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.

Signature

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

*************************************************

| Think outside the box!

*************************************************
>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)
[quoted text clipped - 7 lines]
>
> Please help me to sort this somehow

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.