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

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

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


P: n/a
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

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

Replies have been disabled for this discussion.