
243
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Chapter 12Page Class
12
The Page Class
In contrast to classic ASP, ASP.NET features a far richer object model that allows
virtually every part of an ASP.NET application to be generated and modified
dynamically. Central to this ability to generate—and particularly, to modify—
content programmatically is the
Page class, which is new to ASP.NET.
The
Page class (or a class derived from the Page class) represents a request to an
.aspx page that is processed by the ASP.NET extension to the Internet Informa-
tion Server or to another web server supporting the .NET Framework. The web
page may contain simple HTML and text, .NET code, or a combination of
both; in other words, the
Page class represents a single instance of a Web Forms
page. The requests for that page are served by the compiled object that sends
HTML or other content back to the client.
The Page object is recompiled if any source files that form this page, such as a user
control, a code-behind file, the .aspx page itself, or the application configuration
file, are changed.
In the case of single-file ASP.NET pages (i.e., .aspx files that combine user inter-
face elements with script), the .aspx page is compiled into an instance of a class
that derives directly from the
Page class. This is evident from the following code:
Public Sub Page_Load(o ...