Page Templates
page 1 of 7
Published: 03 Sep 2002
Unedited - Community Contributed
Abstract
There are many ways to get a consistent design across your website and one of these ways is by using page templates. Basically, this involves inheriting from the Page class and implementing your own style in it. This article will take a look at how to use page templates on your site.
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 29285/ 66

Introduction
Introduction

There are many ways to get a consistent design across your website (and this is discussed in another article) and one of these ways is by using page templates. Basically that means that you are inheriting from the Page class and implementing your own style to it. This article will take a look at how you can use page templates on your site.

The Page Class and Page Templates

Your page essentially inherits from a code-behind class and that in-turn inherits from the Page class. The Page class is your ASP.NET page and when compiled, it compiles your page to an object of this class so it can run. The class contains all of the stuff needed to get your page processed and displayed.

Where do page templates fit into all of this?
Page templates are more or less inserted between the code-behind layer and the Page class layer. So going backwards -

  • You page inherits from a code-behind class
  • Which then inherits from your template class (optional)
  • Which then inherits from the Page class

If you check out the documentation for the members of the Page class, you will see numerous methods, properties and events that you have used before (most noticeably the Load event). When you inherit the Page class you essentially get to use the members to create your template and then use that template as what your code-behind inherits from.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-04-28 2:32:32 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search