March 2008
Intermediate to advanced
766 pages
21h 15m
English
The favorite theme feature you created earlier would be a great candidate for a Profile property. What property would you need to add to the profile in web.config to make this possible?
To set the favorite theme in the BasePage, you need to access the Profile in a special way. Instead of accessing the profile on the Page class, you access it through the HttpContext like this:
VB.NET
Dim myProfile As ProfileCommon = CType(HttpContext.Current.Profile, ProfileCommon)
C#
ProfileCommon myProfile = (ProfileCommon) HttpContext.Current.Profile;
Given this code, how can you rewrite Page_PreInit so it gets the preferred theme from the Profile instead of from the cookie?
What else do you need to change to finalize storing the theme in Profile instead of a custom cookie?