Pro ASP.NET 2.0 Website Programming

Pro ASP.NET 2.0 Website Programming Copyright © 2005 by Damon Armstrong All rights reserved. … One scenario in which this may be useful is creating a corporate intranet for a … SBN (pbk): 1-59059-546-7 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the …
Aside from the CSS (Cascading Style Sheet) support inherent in HTML, ASP.NET 1.x did not have any features to help you maintain a consistent look and feel throughout your application. ASP.NET 2.0 remedies that shortcoming with the introduction of Master Pages, themes, and control skins. Master Pages, a much needed and highly anticipated feature, allow you to define and maintain page layouts and common page content from a single file. Themes enable you to apply different CSS and control skins to your application. Control skins allow you to apply properties to specific ASP.NET controls throughout the entire application. This chapter briefly covers each technology and how to use it in your applications. Here is an outline of what you’ll find inside: • Master Page: Demonstrates how you can use Master Pages to create page templates to control the look, feel, and layout of pages in your application. • Themes and Control Skins: Discusses how to create and apply different visual styles to your application using CSS and control skins. Master Pages are, by far, the most popular of these new additions to ASP.NET 2.0, so we’ll begin by taking a look at them and how they can really simplify development. Master Pages One of my current projects truly exemplifies the need for Master Pages. We are building an article- management system for an online publisher whose existing site is managed entirely in static HTML. All the pages on the static site look very professional because the layouts, fonts, colors, and other visual styles are consistent across all the pages. The problem is that they achieved that consistency by copying the base HTML layout into each and every page. As a result, any changes to the site layout have to be made on hundreds of individual pages to maintain consistency. Master Pages allow you to control the look, feel, and behavior of multiple pages in your application from a single location. In a Master Page, you define the basic page layout using HTML and ASP.NET controls and the behavior using server-side code. Building a Master Page is, for the most part, just like working with any standard ASP.NET web form. The most notable difference is that you can add ContentPlaceHold er controls to a Master Page. A Content ? PlaceHolder control defines a region where you can inject content into the Master Page. All other content on the Master Page is locked, so the ContentPlaceHold er controls represent the only locations where content differs from page to page. Pages that employ Master Pages define Content controls that contain the page content. ASP.NET processes requests for these pages by injecting the Content controls on the page into the appropriate ContentPlaceHold er controls on the Master Page at runtime. Figure 3-1 depicts the process.
Download Pro ASP.NET 2.0 Website Programming.Pdf