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

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
 
J

Jimi

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top