473,750 Members | 2,470 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1435
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***@IHATESPA M.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
1428
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 forced to do so through a page reload or clicking a button within the user control itself (thereby reloading the user control). I want to raise an event in the user control whenever an item is added to the cart. This event should cause the current...
5
4809
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 references as to how to do it this way as I already know how. I know this may be getting into advanced or unheard of territory. I have some custom web user controls that are dynamically created at run time along with other controls. I can still add an...
29
15546
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" ---Start of test.aspx---- <%@ Page language="C#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD>
6
1376
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 with 3 columns; TextBox, dropdown and a button ("Delete" button) in each column. Also there's one button at the bottom of the table that allows users to add more rows. So more controls will be added programmatically as user adds more rows. What's...
9
2471
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 post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
4
4201
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 controls as custom server controls and don't understand why this event won't fire. I figured if the creation of the control was in the init, it would be initialized and have its event handlers set up, then after Load, the control would call its...
3
5252
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 handler does not see the combination. Now this control is contained within another control which is contained within another. The top most control does see the CTRL+Z. I can easily pass down the key info, but why does the nested control see...
0
1656
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 html mark-up as it’s UI, i.e. tables, table rows and table cells, and no intrinsic html controls such as input or select. The control does not implement any client-side script and therefore redraws its updated UI on postback through the...
3
2713
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 when the scopes image capture button is pressed, rather than have to capture the image by pressing a button in my app. Thanks in advance
0
9002
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9399
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9345
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6817
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6083
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4895
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.