.NET
  Home arrow .NET arrow Page 2 - Building an ASP.NET 2.0 Master Page in Thr...
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 
Mobile Linux 
App Generation ROI 
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? 
.NET

Building an ASP.NET 2.0 Master Page in Three Steps
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2006-11-20

    Table of Contents:
  • Building an ASP.NET 2.0 Master Page in Three Steps
  • Step 1: Adding a Master.master page to your site
  • Step 2: Adding some features to the Master
  • Step 3: Create a web page which uses the Master
  • Adding an asp:content/ control to the page

  • 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


    Building an ASP.NET 2.0 Master Page in Three Steps - Step 1: Adding a Master.master page to your site


    (Page 2 of 5 )

    Create a web site and call it http://localhost/Tutorials. This comes with a default.aspx page. Go to the menu item Website and click to get the drop down. From the drop down click on Add New Item... as shown in the following picture.

    This gives access to the Visual Studio installed templates window as shown in the next picture.

    Highlight Master Page and it will add a MasterPage.master page to your site when you hit the Add button. Before you hit the Add button, however, change the default name to anything different. Here it is named Tutorial.master. Take a look at the source of Tutorial.master, which is shown in the next picture.

    Two items distinguish this page from an aspx page. It has the @Master directive, and embedded in its body there is an asp control called contentplaceholder.This is a server control.

    The next picture shows the Design view of this Master Page.

    The Master Page is like a super template; into it goes the content that will come from a yet-to-be-created web page.

    There is yet another difference between a Master Page and a regular ASPX page. Even though it has HTML markup, you cannot browse the master on Explorer! In fact if you right click the Master Page, the View in Browser option is missing.

    In principle all the other pages use the Master as their template and add their content to the Master's skeleton. When the page is rendered, the Master and the content from the page will be merged when the client browses the page as explained earlier.

    More .NET Articles
    More By Jayaram Krishnaswamy


       · User experience is one of the most important aspects of web design. The look and...
       · Very nice, easy to understand .NET article.I remember my co-worker advocating...
       · Things are evolving and a open revolution is taking place in the Open Source area....
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT