473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Access Parent Page function from User Control

Hello,

I have a user control that saves data. When the data is saved, I need to
call a function in the parent page from the user control to initiate
something else. I know I can set it up so that the save button is in the
parent page and calls the save function of the user control and then
whatever I need from the parent page, but I'd rather keep the save button in
the user control as I am going to be using the same control elsewhere.

Any ideas?

Thanks,

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Dec 12 '05 #1
1 11403
Hi David,

You might consider defining custom events in your child control (e.g.
SaveCompleted event and OnSaveCompleted event delegate). The custom control
would raise the event after it finished its function. The parent control
would wire up an event handler to continue processing afterwards. This
gives you greater flexibility in passing customized information in the event
argument to the parent that will handle the event. For examples on how to
define events arguments and event delegates in VB.net:
http://www.societopia.net/Samples/Da...olsEvents.aspx
and in C#.net: http://www.societopia.net/Samples/Da...Delegates.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"David Lozzi" wrote:
Hello,

I have a user control that saves data. When the data is saved, I need to
call a function in the parent page from the user control to initiate
something else. I know I can set it up so that the save button is in the
parent page and calls the save function of the user control and then
whatever I need from the parent page, but I'd rather keep the save button in
the user control as I am going to be using the same control elsewhere.

Any ideas?

Thanks,

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Dec 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
3
by: Max | last post by:
I want to do something like this in the user control: Call myParentPage.BindSQL() BindSQL is a sub on the parent page. This user control will be used on multiple pages. Perhaps this is not a...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
5
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access...
1
by: Steve Kershaw | last post by:
I have this web page that has on it a user control. I have a need to access a method that resides in the parent web page from within this user control. It seems that there should be a way to do...
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
5
by: gnewsgroup | last post by:
In my user control, I would like to find a Label control in the parent page (the page that uses my user control). I need to update that Label.Text when something happens in the user control. I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.