By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,965 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,965 IT Pros & Developers. It's quick & easy.

Access Parent Page function from User Control

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.