Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
  #1 (permalink)  
Old February 16th, 2010, 07:50 PM
Registered User
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default IE 8 not displaying MasterPage and CSS

Hello,

I am up to chapter 8 and I have been using FireFox 3.5.7 with windows 7 to view all of my page changes. I had an issue with the vertical banner not showing up in the About Us page so I decided to switch rendering engines to IE 8, this is a FF plug in. The page that was displayed did not seem to be referencing the masterpage and its CSS. So I figured something screwy with the FF plugin so I decided to view the page with IE8 same problem. Also if I view the page using the VWD 2008 internal brower I get the same issue.

Now if I go to the www.planetwrox.com page with either IE 8 or the FF IE
Tab that displays just fine. I have tried to search the forum but I did not see anything close to my issue. Does anything strike you off the top of your head as to where I should start looking, or is their some quirk with IE 8 that I might need to account for?

Thanks.
  #2 (permalink)  
Old February 16th, 2010, 08:21 PM
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.
  #3 (permalink)  
Old February 17th, 2010, 03:13 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The theme is set on the <pages /> element in web.config. Some exercises have you turn it on an off, so maybe you missed the turn on step?

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!
  #4 (permalink)  
Old February 17th, 2010, 03:45 AM
Registered User
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yep I found the step.

Thank you for the quick response.


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS - editing the css style sheet doesn't take effect immediately sayo ASP.NET 3.5 Basics 6 March 13th, 2009 02:32 AM
MasterPage grstad ASP.NET 2.0 Basics 0 June 7th, 2008 04:30 AM
CSS HELP:! CSS EXPANDIBLE BACKGROUND FOR TITLE phpuser2000 CSS Cascading Style Sheets 2 December 19th, 2007 12:36 AM
Displaying Text using CSS austinf CSS Cascading Style Sheets 3 October 11th, 2007 02:58 PM
Rich's new CSS book: Beginning CSS 2nd Edition jminatel BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 June 15th, 2007 11:55 AM





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