Monday, September 6, 2010

Event Delegation in asp.net

Hi friends
I m demonstrate the Event delegation in asp.net.
I am developing a simple asp.net project that handle the event of the web user control to the aspx page.

in simple means click event of the web user control’s button is handle in aspx page.

Create new website. there are default.aspx page

Add new Web User Control named “EventControl.ascx”

in the EventControl.ascx page write the following code.




in the EventControl.ascx.cs page




means we have created event delegate in the EventControl.ascx.cs page now we can code it to default.aspx page.

means in the click event of the EventControl.ascx is written in the default.aspx page.

Now In the Default.aspx file‍







now in the default.aspx.cs file. we are creating the handler of the event

No comments:

Post a Comment