Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 February 17th, 2011, 03:24 PM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with DarkGrey (chapter 6)

Hi Imar,

I completed Try it out upto page 232.

When I select the DarkGrey theme from the dropdownlist, the layout is everywhere, see screenshot -> http://img97.imageshack.us/i/ch6screenshot.jpg/

The Monochrome looks perfect.

I notice in DarkGrey.css that there is no definition to show images for menubackground and sidebar. There are no graphics for it either in the image folder, as there was nothing to copy over - unlike monochrome which has 3 graphics.

Regards
friendl

Last edited by friendl; February 17th, 2011 at 03:58 PM..
 
Old February 17th, 2011, 05:51 PM
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,

Do you still have the styleSheetTheme set to Monochrome in web.config?

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 February 18th, 2011, 04:13 AM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I removed the tag from Webconfig.

My screen now looks like this -> http://imageshack.us/photo/my-images...creenshot2.jpg

Is that correct?

regards
friendl
 
Old February 18th, 2011, 04:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, that looks fine. Looks like you initially missed the tip in the last paragraph on page 231 about removing that attribute from web.condfig.

Cheers,

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 February 18th, 2011, 05:23 AM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, yes I copied over the Css and the image. The header displays ok in Monochrome.

code: default:


Code:
<%@ Page Title="Log into Planet Wrox" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">

    <div id="MainContent0">
        <h1>
            Hi there visitor and welcome to Planet Wrox</h1>
        <p class="Introduction">
            We're glad that you are paying a visit to <a href="http://www.PlanetWrox.com">
            www.PlanetWrox.com</a>, the coolest music community site on the Internet.</p>
        <p>
            Feel free to have a <a href="Default.aspx">look around</a> , there are lots of 
            interesting <strong>reviews and concert pictures</strong> to be found here.</p>
        <p>
            You can<a href="Login.aspx"> log in</a> here.</p>
    </div>

</asp:Content>
frontend.master:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPages_Frontend : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string selectedTheme = Page.Theme;
            HttpCookie preferredTheme = Request.Cookies.Get("PreferredTheme");
            if (preferredTheme != null)
            {
                selectedTheme = preferredTheme.Value;
            }
            if (!string.IsNullOrEmpty(selectedTheme) &&
                        ThemeList.Items.FindByValue(selectedTheme) != null)
            {
                ThemeList.Items.FindByValue(selectedTheme).Selected = true;
            }
        }
    }
    
    protected void ThemeList_SelectedIndexChanged(object sender, EventArgs e)
    {
        HttpCookie preferredTheme = new HttpCookie("PreferredTheme");
        preferredTheme.Expires = DateTime.Now.AddMonths(3);
        preferredTheme.Value = ThemeList.SelectedValue;
        Response.Cookies.Add(preferredTheme);
        Response.Redirect(Request.Url.ToString());
    }
}
 
Old February 18th, 2011, 05:25 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,

I meant the final HTML in the browser, after the page has rendered with the Darkgrey theme applied.

Cheers,

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 February 18th, 2011, 05:28 AM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've posted it under this thread:

Header not showing





Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with the DarkGrey.css theme demac3 BOOK: Beginning ASP.NET 4 : in C# and VB 4 December 12th, 2010 11:30 AM
Chapter 2 problem AccessAd BOOK: Beginning Visual C++ 6 1 May 17th, 2007 04:33 PM
Chapter 2 problem stzd8 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 November 6th, 2006 07:08 PM
Problem in Chapter 9 yoclee BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 August 2nd, 2004 11:10 AM





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