In the. NET Framework, the page class provides basic behavior for all objects built by an ASP.net application from an. aspx file. The class is defined in the namespace System.Web.UI namespace, derived from the TemplateControl, and implements the IHttpHandler interface:
public class Page:templatecontrol, IHttpHandler
TemplateControl is an abstract class that provides basic functionality to ASP.net pages and user controls. The control class is at the top of this hierarchy. It defines the properties, methods, and events that are shared by all ASP.net server-side elements (pages, controls). The structure diagram is as follows:
Important properties of the Page object
Clientquerystring: Gets the query string portion of the requested URL. This property can be used to handle a URL query string in a special format.
Visible: This is a property that overrides the control class if the page Visible is false,asp. NET does not generate any HTML code for this page, only text that uses Response.Write output is displayed.
IsValid: Gets a value that indicates whether the page validation was successful. This property is used frequently with validation controls.
IsPostBack: Gets a value that indicates whether the page is being loaded in response to a client postback, or whether it is being loaded and accessed for the first time. True if the page is loaded in response to a client postback, otherwise false. This property is quite common, we often do some initialization when we first visit the page, we do not do some initialization when we do the postback, we are going to use this property in the Page_Load event to determine if it is a postback.
Request: Gets the System.Web.HttpRequest object for the requested page.
Response: Gets the System.Web.HttpResponse object associated with the System.Web.UI.Page object. This object enables you to send HTTP response data to the client and contains information about the response.
Session: Gets the current session object provided by ASP.net.
Theme: Gets or sets the name of the page theme.
Title: Gets or sets the title of the page, which is useful if you need to dynamically replace the browser page title.
Controls: Gets the System.Web.UI.ControlCollection object that represents the child controls of the specified server control in the UI hierarchy. This is an attribute inherited from the control class. It is useful when we need to access the controls in the page.