Asp. NET Simple Series 3-page class

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.