O'Reilly logo

C# Web Development with ASP.NET: Visual QuickStart Guide by Jose Mojica

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Delegates and Events

Delegates are the foundation of events. If you have used scripting languages before, you should be familiar with the concept of events. A user may interact with a Web page and click a button. The action of clicking generates an OnClick event. The JavaScript in the page may then do something as a result of the click action.

Delegates are classes that store functions. A developer first defines a delegate class. The definition of the delegate—as you will see in the sections in this chapter—contains a prototype for the type of functions that the delegate can store. A developer then declares a variable of the delegate type and assigns a function to it. The function could be an instance function in an object, or a static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required