ASP.NET
  Home arrow ASP.NET arrow Master Pages in ASP.Net 2.0
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Master Pages in ASP.Net 2.0
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 15
    2005-09-15

    Table of Contents:
  • Master Pages in ASP.Net 2.0
  • Master Pages – The Concept
  • Content Pages
  • Going Beyond the Basics

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Master Pages in ASP.Net 2.0


    (Page 1 of 4 )

    ASP.Net has provided us with powerful mechanisms to separate code and functionality from design and the user interface, by such concepts as web controls and code-behind. With ASP.Net 2.0, Microsoft has taken it up a notch, allowing us to completely separate the templates of the entire site from any code in individual pages, through a new concept called Master Pages.

    Introduction

    Generally speaking, web programmers are not designers. Not by a long shot. That’s the reason we love programmable web controls. We can insert them on the page, do all the programming around them in the code behind, and let the designer worry about how it all looks (without messing up our code!). It’s also why tools such as DreamWeaver are so popular. We can design templates, create pages based on those templates, modify only certain pieces of the page, and let DreamWeaver handle any updates to pages for which the template has been modified.

    With old-school ASP, we used include files, and we used them nefariously. Every single navigation element and widget and snippet got thrown into an ASP page, and we would toss in our include statements all over the place, making it sometimes incredibly fun to find a programming error, or even a twice declared variable.

    Then with ASP.Net 1.1, we had something of a mind-shift to object-oriented programming. Here we were able to plug in other server controls, HTML, and programmatic code, and encapsulate them all into one "user control." We could then plug that user control onto any number of pages in our application, and use that functionality all over the site. Of course, then you ran into somewhat serious issues when you needed to modify a user control. If you made any changes to the properties, methods, or events in a single user control, you would need to recompile all pages that used that control, as well as redeploy the entire assembly. And then the first visitor to the page gets the unwelcome surprise of waiting for the .Net runtime to recreate it.

    So to not only address these issues, but also give the advantage of being able to template your entire site with one page, Microsoft has come up with Master Pages.

    More ASP.NET Articles
    More By Justin Cook


       · Hi Everyone,just a quick note from the author here: hope you enjoy the article,...
     

    ASP.NET ARTICLES

    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway