What is So Good About ASP.NET Master Pages
ASP.NET master pages are a powerful feature which allows developers to create template-like pages which contain information that is common to all pages in a site or all pages in one section of a site such as corporate logo, company information, headers, footers and navigation links. Content pages can then be created which are based on the master page(s). Master pages use the file extension andquot;.masterandquot; which is automatically protected by the server and cannot therefore be downloaded by clients.
Content pages contain a reference to the appropriate master page together with the main page content. They use the regular ASP.NET file extension: andquot;.aspxandquot;. When the client requests a content page, the master and content pages are combined on the server and the resulting page sent back to the client.
Master pages contain locked areas, which can only be edited from the master and content areas, which can be filled with unique content each time a content page is created. You can create as many content areas as you need, though the default of one in the head area and one in the body is usually enough.
To create a master page in Visual Studio or Visual Web Developer, choose Add New Item from the Website menu and click on the Master Page icon. As with regular ASP.NET pages, you can choose the coding language and specify whether code will be placed in an external file or embedded in the page itself. To create a content page, choose Add New Item from the Website menu, click on the Web Form icon and activate the option andquot;Select Master Pageandquot;. When you click the Add button, a second dialog will appear allowing you to choose a master page.
Master and content pages are great to work with from the developer's point of view: they offer a great way of controlling the structure and layout of all the pages in a site. In addition, when working on content pages in Visual Studio or Visual Web Developer, the master page elements are displayed in preview mode, so the developer can always see what the final, composite page will look like to the end user. Naturally, however, the master page items cannot be edited from the content page.
Adobe Dreamweaver users may be tempted to make a comparison between Dreamweaver templates and ASP.NET master pages. However, ASP.NET master pages are much more powerful. In Dreamweaver, all of the template markup has to be copied into each page based on a template. If the template is altered, each page based on the template has to be updated and then uploaded to the server. With ASP.NET master pages, the master page elements are automatically combined with the content page element at runtime by the ASP.NET engine. So when a master page is altered, there is no need to manually update the content pages.
Writer conducts ASP.NET training courses and ASP training throughout the UK.
All Best Articles at http://www.allbestarticles.com
You Can Link Directly to "What is So Good About ASP.NET Master Pages"
by using the url: http://www.allbestarticles.com//computer/training/what-is-so-good-about-asp.net-master-pages.html
Add Your Picture
Article Submitted By:
ChristopherHarris
This Article Has Been Read 891 Times
Publish/Share this article
Remember: The article body, title, author bio and links may not be changed or removed. By publishing this article, you agree to all the terms in our Terms of Service.
Get the HTML for reprinting the article to your site
Rating: 2.0
Firms Face Legal and Regulatory Challenges after Security Breach Incidents
Information Security Professionals Detect Data Breach at Sony Online Entertainment
SQL Injection Attack and Employee Negligence Cause Data Exposure
Data Breach Incidents Underscore Need for Proactive Approach to Information Security
An Analysis Of Cisco Networking Technical Support Interactive Training
Microsoft .Net Programming CBT Home-Based Multimedia Certification Training Courses
Learning About Computers With Training Courses
Considering Microsoft IT Career PC Self-Study Certification Courses
Adobe CS4 Design Home-Based Multimedia Certification Courses Clarified
CBT Computer Home-Based Certification Training In Adobe CS4 Design
Computer Home-Based Certification Training Courses For CompTIA Networking Technical Support
Home Computer Careers Training For The IT Industry
