10 CHAPTER 1 ?– SERVER CONTROL BASICS
The Page class in the ???Hello, World??? example consumes the Click event raised by the
Button to read values and sets the first Label control. The Button Click event is easy to map in
the Designer by simply double-clicking the button. Double-clicking a control in Visual Studio
automatically generates the default event handler for the control. In the case of the Button, it is
the Click event. In addition, Visual Studio performs other housekeeping tasks, such as wiring
up the event delegate exposed by the Button control to the generated method (in this case,
Button1_Click) in the Page class.
?– Note In the .NET Framework 2.0 and later, the concept of a partial class exists where a class can be split
across multiple files. This allows Visual Studio or similar non-Microsoft tools to provide better design-time
support.
Events in ASP.NET take advantage of delegates as the infrastructure for this communication
among objects. In Chapter 5, we discuss how to work with events in detail.
The Properties window in the Design view of the Visual Studio Designer can help map the
events from a control that don??™t result from double-clicking the control.
?– Note Click the yellow lightning bolt icon at the top of the Properties window to filter the view to show only
events exposed by a particular control.
Pages:
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60