What are Delegates? Explain with an explain how to implement delegates in ASP.NET.- Delegates provide the functionality behind events.
- A delegate is a strongly typed function pointer.
- Invoke a method without making an explicit call to that method.
- In Visual Basic .NET, the role of the delegate is largely behind the scenes
- A delegate is a type that represents references to methods with a particular parameter list and return type.
- When a delegate is instantiated, it can be associated by its instance with any method with a compatible signature and return type.
- They can invoke (or call) the method through the delegate instance.
- Delegates are used to pass methods as arguments to other methods.
- Event handlers are nothing more than methods that are invoked through delegates.
- You create a custom method, and a class such as a windows control can call your method when a certain event occurs.
|