473,398 Members | 2,368 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,398 software developers and data experts.

Capturing event from other custom control within another custom control

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
1 1413
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philip Townsend | last post by:
I have a user control that displays the contents of a shopping cart. I want this control to update its contents whenever an item is added to the cart. Currently, the cart only updates if it is...
5
by: Dan | last post by:
Hi, I'd like to find out the control that caused a postback to be raised. Obviously this could simply done in a control event handler. I am not going to do this method and would like no...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
6
by: WebMatrix | last post by:
Hello, Here's the situation (I'll try to be brief as possible) I am working on the control which is created dynamically based on XML string. This control consists of a table with number of rows...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
4
by: TS | last post by:
I am creating a User control and i create some dynamic controls in the init handler. one of the controls is a custom validator which i assign a serverValidate event handler. I usally always do my...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
0
by: =?Utf-8?B?TWFyayBHaWxrZXM=?= | last post by:
I have designed and written a custom menu like server control. The control inherits from DataBoundControl and implements INamingContainer and IPostBackEventHandler interfaces. The control uses only...
3
by: ghostrider | last post by:
Does anyone know how to recognise the image capture signal from a medical scope such as a video colonoscope? I've got video streaming from the scope to the computer but want my app to recognise...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.