That takes care of having a place to store each user s preferred theme. In code, you can use Profile.PreferredTheme whenever you want to get, or set, the current user s preferred theme. Next, you need some means of allowing users to explore themes and choose one, which means some sort of interactive form. Creating a page for viewing themes Next, you d need a page where a user can go and take a look at various themes, and then choose a preferred theme. On my site, this page would go in my MemberPages folder because I d only allow authenticated users to choose themes. So it s just a matter of right-clicking the MemberPages folder and choosing Add New Item. I d choose Web Form as the template, enter ChooseTheme.aspx as my page, choose Visual C# as the language, and check both the check boxes for choosing a Master Page and using a code-behind page. Nothing new or different there. To allow users to choose a theme, you ll need a control that allows users to choose any one of several mutually exclusive options such as a drop-down list, a list box, or perhaps a set of option buttons (although you could just as easily use buttons or links). The page also needs some content that uses styles defined in the themes. That way, when the user chooses a theme, you can simply apply the theme to show the user how the theme looks. How you design the page is entirely up to you, of course. As an example, I started off with the page shown in Figure 10-12. Chapter 10: Using Themes 211
We highly recommend you visit
web and email hosting services if you need stable and cheap web hosting platform for your web applications.
This entry was posted
on Monday, July 23rd, 2007 at 9:34 pm and is filed under Linux.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.