473,388 Members | 1,256 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,388 software developers and data experts.

How exactly can I get my main page to know that an event was raised on a user control?

Hello,

I have a user control that has radio buttons and a listbox. This user
control is repeated several time on my webpage.

What I want to do is alert the main page that the radio buttons were clicked
(changed). I know this has to do with Events and I can see the changed event
and work with it within the user control. I just don't know how to have that
Event sent (or raised) to the page holding all the user controls.
Specifically, I want to listbox to fill with different data based on which
radio button was clicked, and access to the data is held outside the user
control.

I have seen that this has to do with delegates and consuming events, but I
am specifically looking for the actual code (C#) that makes the main page
react (consume?) when the radio button is clicked on the user control.

I hope that is clear. Because I am having a hard time getting my head around
Events and Delegates.

Thank you for the help.

-Rob
Sep 11 '06 #1
2 1578
look at this... it may help :

http://msdn2.microsoft.com/en-us/lib...nthandler.aspx

I hope it helps

ThunderMusic

"Gummy" <gu*******@hotmail.comwrote in message
news:12*************@corp.supernews.com...
Hello,

I have a user control that has radio buttons and a listbox. This user
control is repeated several time on my webpage.

What I want to do is alert the main page that the radio buttons were
clicked
(changed). I know this has to do with Events and I can see the changed
event
and work with it within the user control. I just don't know how to have
that
Event sent (or raised) to the page holding all the user controls.
Specifically, I want to listbox to fill with different data based on which
radio button was clicked, and access to the data is held outside the user
control.

I have seen that this has to do with delegates and consuming events, but I
am specifically looking for the actual code (C#) that makes the main page
react (consume?) when the radio button is clicked on the user control.

I hope that is clear. Because I am having a hard time getting my head
around
Events and Delegates.

Thank you for the help.

-Rob


Sep 11 '06 #2
Thank you for the information. I will take a look at this. It certainly
appears to be what I need.

I've seen in VB.NET (for ASP) you can add the event with the Handles
keyword. I am trying to figure this out for C#.
"ThunderMusic" <No*************************@NoSpAm.comwrote in message
news:uj**************@TK2MSFTNGP03.phx.gbl...
look at this... it may help :

http://msdn2.microsoft.com/en-us/lib...nthandler.aspx
>
I hope it helps

ThunderMusic

"Gummy" <gu*******@hotmail.comwrote in message
news:12*************@corp.supernews.com...
Hello,

I have a user control that has radio buttons and a listbox. This user
control is repeated several time on my webpage.

What I want to do is alert the main page that the radio buttons were
clicked
(changed). I know this has to do with Events and I can see the changed
event
and work with it within the user control. I just don't know how to have
that
Event sent (or raised) to the page holding all the user controls.
Specifically, I want to listbox to fill with different data based on
which
radio button was clicked, and access to the data is held outside the
user
control.

I have seen that this has to do with delegates and consuming events, but
I
am specifically looking for the actual code (C#) that makes the main
page
react (consume?) when the radio button is clicked on the user control.

I hope that is clear. Because I am having a hard time getting my head
around
Events and Delegates.

Thank you for the help.

-Rob


Sep 11 '06 #3

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

Similar topics

5
by: Jay | last post by:
I have a situation where the user clicks on a button in a DataGrid to launch a popup window via javascript. In the popup window the user does some things that result in changes to the underlying...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
2
by: jw56578 | last post by:
Hi, How would the following be accomplished. I have a parent aspx page, that dynamically loads 3 user controls (through LoadControl) depending on a certain criteria. I want the click of a button...
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...
0
by: Ben S | last post by:
vs2005, .net fw 2.0 the questions is, how can I cause the label to change in my client page triggered by an event raised from the user control which is on my master page. I have a master page...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
3
by: =?Utf-8?B?VDhS?= | last post by:
Ok...I've been looking for an answer to this problem and can't seem to find one...Framework 1.1 mind you. I have a base class that inherits from UserControl. I have 5 and soon to be 12 user...
1
by: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.