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

  • Thread starter Thread starter Jimi
  • Start date Start date
J

Jimi

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
 
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
 
Back
Top