.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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 / 32
    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

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek