Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 13th, 2015, 12:54 PM
Registered User
 
Join Date: Mar 2014
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch. 6 browser showing combination of the two themes C# only, VB is fine

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
 
Old May 15th, 2015, 02:39 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

That's odd. Are you sure you updated the correct web.config?

Can you post the code for the following:

Master Page (Markup and Code Behind)
BasePage.cs
Webconfig

When you post code, please paste it in Notepad first to remove color coding, then copy and paste it in the editor here and use the Code button (#) to mark it as code.

Thanks,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old May 15th, 2015, 08:51 AM
Registered User
 
Join Date: Mar 2014
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not a problem anymore.

Hi Imar,

I figured out the issue - it was related to what was going on in the Chapter 6 C# Code Seems to be Self Generating thread. My response to you in that thread explains everything. Almost.

Best regards,
Tim Mulherin





Similar Threads
Thread Thread Starter Forum Replies Last Post
Title Showing in Top Left Browser Jeff777 Dreamweaver (all versions) 2 July 3rd, 2016 03:30 AM
Ch 6 Stuck on the DDL for Themes Aristide BOOK: Beginning ASP.NET 4.5 : in C# and VB 6 April 1st, 2014 10:37 PM
Image is not showing .. when handling themes. manoj.aggarwal ASP.NET 2.0 Professional 0 August 7th, 2007 03:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.