Duration: 17 minutes
Summary: In this video, we discuss couple of items: 1) how to add a css stylesheet to a skin folder and 2) how to load themes dynamically. First we start with the stylesheet. We have the option of adding stylehseets to the skin folder. When we use a skin in a specific page, that style will be applied as well. We showed an example by adding some styles to the page and controls in the TextBox theme. In the second part we illustrate the idea of loading themes dynamically. We created two pages: the first page asks the user for a theme using a drop down, and the second page reads the user’s selection from the query string and loads the theme for the page. The key point here is that the loading of the theme should happen in the Page_PreInit event, because loading it in any other event will be already too late.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: ASP.NET and Visual Studio 2010Keyword: ASP.NET 4, Visual Studio 2010, Themes, Skins, CSS, Style Sheets, Buttons, Labels, Page_PreInit