Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
why do we use : System.Web.UI.Page after the class declaration??
Posted

The Page Class

Represents an .aspx file, also known as a Web Forms page, requested from a server that hosts an ASP.NET Web application.

Where The Page type exposes the following members.
Constructors

Name = Page

Description = Initializes a new instance of the Page class.


Public Partial Class MyClass : System.Web.UI.Page
{

}

Here The Page Class Is Inherited By The Class
 
Share this answer
 
Hi,

System.Web.UI.Page is .net framework class library, which is responsible to make your file as aspx, and handle request, response to server. It helps us to create our own page which works like aspx page and handle all events. Without System.Web.UI.Page your page will become bunch of text and will not handle any event.

For more detail
http://msdn.microsoft.com/en-us/library/system.web.ui.page.aspx[^]
 
Share this answer
 
Refer to this link. It states that,
Quote:

System.Web.UI represents an .aspx file, also known as a Web Forms page, requested from a server that hosts an ASP.NET Web application.

The Page class is associated with files that have an .aspx extension. These files are compiled at run time as Page objects and cached in server memory.

If you want to create a Web Forms page using the code-behind technique, derive from this class. Rapid application development (RAD) designers, such as Microsoft Visual Studio, automatically use this model to create Web Forms pages.

The Page object serves as the naming container for all server controls in a page, except those that implement the INamingContainer interface or are child controls of controls that implement this interface.

The Page class is a control that acts as the user interface for your Web application, and as such should be scrutinized to make sure best practices for writing secure code and securing applications are followed.

Regards..:laugh:
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900