![]() ![]() | ||
Any Web page requested from a server hosting the .NET framework, whether it contains .NET code or only HTML text, is actually based on the System.Web.UI.Page class; this is the class that our Web forms inherit from:
Public Class WebForm1 Inherits System.Web.UI.Page ⋮
Here is the class hierarchy for the Page class (note that the Control class here is the ASP .NET Control class, not the Windows application's Control class):
Object Control TemplateControl Page
You can find the notable public properties of Page objects in Table 14.5, the notable methods in Table 14.6, and the notable events in Table 14.7. Note that I'm not including all the properties, methods, and events that the Page class inherits from the System.Web.UI.Control class—you can find them in Chapter 15, Tables 15.1, 15.2, and Tables 15.3. (The Page class doesn't inherit members from the TemplateControl class that you normally deal with directly.)
Method |
Means |
---|---|
HasControls |
Indicates if the form has any child controls. |
LoadControl |
Gets a UserControl object. |
MapPath |
Connects a virtual path to an actual path. |
ResolveUrl |
Converts a relative URL to an absolute URL. |
Validate |
Validates data using validation control in the page. |
Event |
Means |
---|---|
Disposed |
Occurs when a Web form is disposed. |
Error |
Occurs when an unhandled exception has occurred. |
Init |
Occurs when the Web form is initialized. |
Load |
Occurs when the Web form is loaded. |
Unload |
Occurs when the server control is unloaded. |
![]() ![]() | ||