Conclusion : Skin file and server side control

One of the most often requested features for ASP.NET has been to support a common look and feel for a site. The Master Pages feature within ASP.NET 2.0 pushes this capability to the forefront and makes developing a set of pages with similar aspects a very doable proposition. In addition to Master Pages, ASP.NET 2.0 Themes represent a way to apply global style attributes to all the pages in your application.

ASP.NET also supports specifying default values for specific server-side controls through a Skin file. Skins offer a finer-grained approach to applying styles in a control-centric manner.

Tutorial 8 Quick Reference

How to define a page that will represent the common look and feel of a series of pages in a Web site

Add a Master Page to the site

How to create a page based on the Master Page

Check the Select master page check box when creating forms for a site

How to add elements to the Master Page that will show up in pages based on the Master Page

Place elements outside the area represented by the content pane. A Layout table is useful for this

How to add individual elements to content pages

Add elements within the content page shown on the page

How to create a Theme for a page

Add a new Theme folder to the App_Theme folder within your application. Use a Cascading Style Sheet (CSS) to define styles and classes for the Theme

How to apply a Theme to a page

  1. Set the Theme property within the Page Directive


  2. Set the Theme property within the page during the page's PreInit event

How to create a Skin

Create a text file within a Theme folder. Name the file <whateverthethemefolderis>.skin. Add control declarations with their properties set to default values