Tying the Look to User Profiles
To make a theme "stick" with a user, you'll need a profile property to store his or her favorite theme name. Going back to our first web.config example in Listing 12.1, you simply need to add a profile property called Theme and set its type to System.String. Regardless of the profile provider you use (unless of course your own custom provider doesn't deal with the Theme property), Listing 12.11 shows how your page can set the theme for the user.
Listing 12.11. Setting the theme for a user with Profile
C#
VB.NET
void Page_PreInit(object sender, EventArgs e)
{
Theme = Profile.Theme;
}
Sub Page_PreInit(sender As Object, e As EventArgs)
Theme = Profile.Theme
End Sub