Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET 2.0 Raising a custom event from a usercontrol to parent page: How?

Reply
Thread Tools

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

 
 
Jimi
Guest
Posts: n/a
 
      03-25-2006
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



 
Reply With Quote
 
 
 
 
Jimi
Guest
Posts: n/a
 
      03-26-2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Raising Parent Event Causes Clientid To alter jw56578@gmail.com ASP .Net 0 04-09-2005 07:40 PM
Solution: Raising an Event Handler Postback on Parent Window From Popup Child Window Dialog Box Earl Teigrob ASP .Net 1 06-16-2004 04:19 PM
Raising an Event from a UserControl contained in an IFRAME? Jeremy Howard ASP .Net 0 02-17-2004 12:46 AM
Raising an Event from a UserControl contained in an IFRAME? Jeremy Howard ASP .Net 0 02-15-2004 12:44 AM



Advertisments