ASP.NET 2.0 Raising a custom event from a usercontrol to parent page: How?

Discussion in 'ASP .Net' started by Jimi, Mar 25, 2006.

  1. Jimi

    Jimi Guest

    Hi all, I have a user control which I want to raise a custom event from so
    the parent page can reload a datagrid with some new information.

    In the 1.1 framework days I would have just done something like the
    following in my user control:

    public delegate void _departmentClick (object sender, int e);
    public event _departmentClick DepartmentClick;

    And then called the DepartmentClick event when I wanted to inform the parent
    page.

    Then in the parent page I would have explicitly created the usercontrol and
    created an event handler for the DepartmentClick event. No worries...

    How the hang do I do the same thing in ASP.NET 2.0?

    I can create the delegate etc no problem in the UserControl but in the
    parent page, how / where do I create the event handler???

    TIA
    Mark
     
    Jimi, Mar 25, 2006
    #1
    1. Advertising

  2. Jimi

    Jimi Guest

    Hi all, I fixed my own problem, it is pretty much the same as 1.1. I just
    did not have to declare an instance of the user controls as asp.net 2.0
    automatically picked up that there was an instance of the user control on
    the page.

    Cheers
    Mark
    "Jimi" <> wrote in message
    news:%...
    > Hi all, I have a user control which I want to raise a custom event from so
    > the parent page can reload a datagrid with some new information.
    >
    > In the 1.1 framework days I would have just done something like the
    > following in my user control:
    >
    > public delegate void _departmentClick (object sender, int e);
    > public event _departmentClick DepartmentClick;
    >
    > And then called the DepartmentClick event when I wanted to inform the
    > parent page.
    >
    > Then in the parent page I would have explicitly created the usercontrol
    > and created an event handler for the DepartmentClick event. No worries...
    >
    > How the hang do I do the same thing in ASP.NET 2.0?
    >
    > I can create the delegate etc no problem in the UserControl but in the
    > parent page, how / where do I create the event handler???
    >
    > TIA
    > Mark
    >
    >
    >
     
    Jimi, Mar 26, 2006
    #2
    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. Jeremy Howard
    Replies:
    0
    Views:
    1,275
    Jeremy Howard
    Feb 15, 2004
  2. Jeremy Howard
    Replies:
    0
    Views:
    545
    Jeremy Howard
    Feb 17, 2004
  3. Earl Teigrob
    Replies:
    1
    Views:
    5,883
    Earl Teigrob
    Jun 16, 2004
  4. okaminer
    Replies:
    4
    Views:
    2,729
    okaminer
    Feb 15, 2005
  5. Replies:
    0
    Views:
    410
Loading...

Share This Page