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

Capturing event from other custom control within another custom control

P: n/a
Hello,

I'm trying to build an "add-on" to an already existing custom web user
control. The old control collects some user data and saves it to a database.
The new control should collect some extra info from the user and add it to a
new table in the database.

The old control should not be re-written (at least not now..), so I need a
way of capturing the click event of the Save button in the old control. This
event should trigger a function in the new control that saves the "add-on"
data.

Both controls are being added to the page at run-time and has the save level
(the new control is no child control to the old one).

Correct me if I'm wrong, but I can't use bubbling events since the new
control isn't a child control to the old control, right?

What should I do?

Thanks for any help!

Regards,
Jonah Olsson
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Jonah:

Ideally you could handle the logic from some higher controller entity
that knows what all the moving parts are and how to orchestrate them.
This way the controls don't couple themselves together. If you want,
you could think as the parent page as the controller, have it catch
events from one control and forward the event to the second control.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 5 Apr 2005 01:09:53 +0200, "Jonah Olsson"
<jo***@IHATESPAM.com> wrote:
Hello,

I'm trying to build an "add-on" to an already existing custom web user
control. The old control collects some user data and saves it to a database.
The new control should collect some extra info from the user and add it to a
new table in the database.

The old control should not be re-written (at least not now..), so I need a
way of capturing the click event of the Save button in the old control. This
event should trigger a function in the new control that saves the "add-on"
data.

Both controls are being added to the page at run-time and has the save level
(the new control is no child control to the old one).

Correct me if I'm wrong, but I can't use bubbling events since the new
control isn't a child control to the old control, right?

What should I do?

Thanks for any help!

Regards,
Jonah Olsson


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.