Bullet 4 page 244 states "If you find that the page in the browser is showing a combination of the two themes, go back to VS, open Web.config, and remove the styleSheetTheme attribute from the <pages> element, leaving the theme attribute in place because it serves as the default for new visitors".
I did this:
Code:
<!-- web.config -->
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
<pages theme="Monochrome" />
</system.web>
<!-- BasePage -->
private void Page_PreInit(object sender, EventArgs e)
{
HttpCookie preferredTheme = Request.Cookies.Get("PreferredTheme");
if (preferredTheme != null)
{
string folder = Server.MapPath("~/App_Themes/" + preferredTheme.Value);
if (System.IO.Directory.Exists(folder))
{
Page.Theme = preferredTheme.Value;
}
}
}
The Monochrome theme is fine but when I switch to DarkGrey I get a jumble of both themes.
I am getting the same result using IE, Fox, or Chrome. Again, the
VB version is switching between the themes as advertised. I would post a screen shot but for some reason [img] code is off and I cannot figure out how to enable it. Finally, I am using VS 2013 if that makes any difference.
Best Regards,
Tim Mulherin