2
Reply

What is delegates and events in ASP.NET 2.0.

sanjeev singh

sanjeev singh

15y
14.6k
0
Reply

    Delegate and Events are use in common , Delegate is Like function pointer in C( a pointer holding the refference  to a Function )  , the difference between Function pointer and delegate is that delegates are strongly typed i.e. only at run time it knows which function to point , events are the Events which occured in an application , for every event we need an eventhandeler in our application , but we can have so many event and so many event handelers , to bind an event to its eventhandeller at runtime we use delegate , delegate matches the signature of the Eventhandeler if it match with the delegate signature then control will move to that event handeler , but before that we need to bind the event to a eventhandeler . we can do this by using += operator.

    Hi,

    Delegate :Dalegate is Nothing but it can be hold the Addresss of Function,it will improve the Performance of the Application,

    Event:Event is nothing But Action Identified the particular Instance ,Example :Button Click Event

    Thanks,

    Narasima