Page Template

Topic updated 17-10-2007

The Page Template is the main Project Item Template in the ASP.NET 2.0 Templates. It generates one of the following:

An ASP.NET 2.0 Web Form, composed of an .aspx file and an .aspx.cs file. The Web Form is optionally connected to an ASP.NET 2.0 Master Page generated with the Master Page Template.
An ASP.NET 2.0 Web User Control, composed of an .ascx file and an .ascx.cs file

 

The Wizard is an effective tool to add Page Templates to projects, both at project setup and later on during project development. The Wizard creates  pre-configured, functional pages containing many templates such as Browse Templates, Form Templates, Property Templates and Action Templates.

Alternatively, you can add a blank Page Template from the Project Explorer using the context menu of the ASP.NET project node or the Pages node.

 

Editing pages

With the Source Editor you can add custom source code to all generated files of a Page Template.

Using the WebForm Designer you can visually edit the user interface generated by a Page Template, adding and configuring functionality with the following components:

Control Templates, including Databound Control Templates such as the Browse Template, the Form Template and the DropDown Template.
Web User Controls generated with the Page Template (see Adding a Web User Control to a page).
Standard ASP.NET 2.0 Server Controls.

 

Controlling page appearance

To control appearance of generated pages the ASP.NET 2.0 Template rely on ASP.NET 2.0 Themes, which control the look and feel of all page content generated by all templates. The Theme to be used can be set per Page Template, so multiple Themes may be used in a project. Themes can be developed outside GenWise Studio.

The Master Page Template provides a standard layout for pages. This layout may also include various controls.

While the use of Themes is recommended for managing appearance throughout your ASP.NET project, the visual editing facilities of the WebForm Designer can be used to perform visual tweaks on individual pages.

 

Page Template Settings

The page template settings are shown below:

aspnet_pagetemplate

 

Page type

Standard page or Usercontrol

Use a Master Page

Check to use a masterpage, uncheck to generate standalone webforms

Title of the Page

The page title in the browser

Page Theme

Set the theme for this page. This is a global template option and can be set for all pages in the global settings. Page themes are ASP.NET 2.0 themes.

Encrypt page viewstate

Encrypt the viewstate

Pages Namespace

The namespace for the page class