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

Discussion in 'ASP .Net' started by Gummy, Sep 11, 2006.

  1. Gummy

    Gummy Guest

    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
    Gummy, Sep 11, 2006
    #1
    1. Advertising

  2. Gummy

    ThunderMusic Guest

    look at this... it may help :

    http://msdn2.microsoft.com/en-us/library/system.web.ui.ipostbackeventhandler.aspx

    I hope it helps

    ThunderMusic

    "Gummy" <> wrote in message
    news:...
    > 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
    >
    >
    ThunderMusic, Sep 11, 2006
    #2
    1. Advertising

  3. Gummy

    Gummy Guest

    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" <> wrote in message
    news:...
    > look at this... it may help :
    >
    >

    http://msdn2.microsoft.com/en-us/library/system.web.ui.ipostbackeventhandler.aspx
    >
    > I hope it helps
    >
    > ThunderMusic
    >
    > "Gummy" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
    Gummy, Sep 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Karl
    Replies:
    1
    Views:
    4,049
    =?Utf-8?B?U2hhd24=?=
    Aug 28, 2004
  2. Gummy
    Replies:
    0
    Views:
    323
    Gummy
    Sep 13, 2006
  3. Fabrizio
    Replies:
    5
    Views:
    233
    Alessandro Zifiglio
    Feb 24, 2004
  4. NH
    Replies:
    2
    Views:
    527
    Andrew L. Van Slaars
    Dec 17, 2004
  5. Robert Oschler
    Replies:
    1
    Views:
    390
Loading...

Share This Page