ASP.NET Whidbey Overview
page 3 of 14
by Steven Smith
Feedback
Average Rating: 
Views (Total / Last 10 Days): 57444/ 108

Master Pages

With ASP.NET 1.x, it's too hard to create a common look for a site.  The standard options include creating header and footer (at least) user controls and adding them to every page, or using a base page class, or some combination of these two.  A couple of good articles on these techniques can be found here:

The downside to these options is that they're not natively supported by the framework, so any solution is going to be a custom solution, and thus not something you're likely to be able to reuse between organizations.  Further, there's not much IDE support for any of these techniques.

With Master Pages, it is very easy to create a template page for the site (a 'master' page) and save it with its own extension (.master).  Any page can inherit its visual formatting from a master page through a page directive.  Master pages can inherit from other master pages.  Content can be place in one more more regions within a master page, not just a single place around which all other UI is placed (as is common with today's techniques).  Lastly, there is excellent IDE support for master pages, as this screenshot demonstrates:

Master Page IDE

This is a page that has specified a master page.  As you can see, some of it is greyed out and some of it is enabled.  The grey portion is the master page content, and can be edited only by right clicking and selecting "Edit Master".  The other section of the page is a content area that can be manipulated on this page.  In this case, this is the home page of an "Internet Site" that can be created as a sample project in either VB or C#.  More on these sample projects later.


View Entire Article

User Comments

Title: very good article   
Name: raja raja
Date: 2009-12-04 7:57:23 AM
Comment:
very good and informative website.
Title: nice artical   
Name: abdulla hussein
Date: 2007-04-29 6:28:16 AM
Comment:
I like it , it is very informative . thanks alot man

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-29 8:08:21 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search