ASP.NET 2.0 Tutorials : The Page Object Model

The Page Object Model

In this tutorial you will learn about Page Object Model, the Attributes of the @Page directive, the properties of the Page Class, Methods of the Page Class, Page Class Events and the Page Scripting Object Model.

The page class is represented by the .aspx file in ASP.NET 2.0. It provides the basic behaviour for all pages. A class is dynamically created when the .aspx file is parsed and this class inherits from the page class. In ASP.NET 2.0, the page class allows code separation. It invokes the IHTTPHandler interface to service the requests for the page. The page class also inherits from the TemplateControl class and so functions like a control. Since it implements the IPaginationContainer interface the page is paginated by the new Pager control.



The Attributes of the @Page directive

It is interesting to note that the behaviour of each page can be controlled using the attributes of the @Page directive. ASP.NET has not revolutionized the Page class, but it has enhanced it by adding new features to it. The @Page directive is the point of control for the developer. The new attributes that have been added to this directive are:

1. Async: If this is set to true, the page class that is generated derives from IHttpAsyncHandler. It adds some built in asynchronous capabilities to the page.

2. CompileWeb: This attribute specifies the name of the referenced code-beside file to use for the page.

3. EnablePersonalization: Indicates whether profile information should be used to build the page.



Read More...

http://www.exforsys.com/content/view/1621/354/