View Single Post
 
Old February 16th, 2010, 08:21 PM
JTighe JTighe is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found the issue. With IE 8 the first time you view the page there is not Page.Theme to set and there is no Cookie everything null. Once you change the format then you have a cookie to get all of you data from.

Added this code.

Code:
    private string baseTheme = "DarkGrey";
    private void Page_PreInit(object sender, EventArgs e)
    {
        HttpCookie preferredTheme = Request.Cookies.Get("PreferredTheme");

        if (preferredTheme != null)
        {
            Page.Theme = preferredTheme.Value;
        }
        else
        {
            Page.Theme = baseTheme;
        }
    }
Now if I clear my cache and go to the page for the first time, at least as the browser believes it to be, I will default to the "DarkGrey" Theme. I briefly skimmed over Chapter 6 again and did not see anywhere that you added a default theme. If you did can you please let me know where? I may have an older copy.

Thanks again.