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 April 20th, 2011, 12:48 PM
Registered User
 
Join Date: Apr 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu Items not Formatting Correctly

I am on the menu exercise in Chapter 11. I have modified the Monochrome.css file to include the formatting items, e.g.,

ul.level1
ul.level1 .selected
a.level1

etc etc

but none of the formatting appears, just the formatting set in .MainMenu

Wayne
 
Old April 20th, 2011, 01:27 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 Wayne,

When you look at the HTML in the browser, can you see the menu is made up of <ul> and <li> elements?

And could it be that you're having other CSS for ul elements that overrides your settings? And are you sure the correct CSS is being used and applied to the page? E.g. what happens when you add

*
{
border: 1px solid red;
}

to the CSS file?

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 April 20th, 2011, 01:42 PM
Registered User
 
Join Date: Apr 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had checked those things, and it turned out to be something interesting I just found - in the web.config file, in <pages> it had the controlrendering=3.5 directive. Once I removed it, all was well. I'm not sure what happened. If I remember correctly I started developing in 3. because that's what our company servers are at, then decided to migrate the project to 4 just so I could work with the latest features and we will be migrating pretty soon anyway
 
Old April 20th, 2011, 01:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I was going to ask you next to post the web.config to look at exactly that ;-)

When you upgrade a site from 3.5 to 4.0, VWD adds that to the config file to maintain backwards compatibility. In 3.5, the Menu rendered as a table, so you could have had CSS targeting that specific table. In 4.0 it renders as <ul> elements, so upgrading might break things.
With controlrendering set to 3.5, ASP.NET 4 renders the way it did in 3,5; e.g. you get tables instead of an unordered list (and hence the question: When you look at the HTML in the browser, can you see the menu is made up of <ul> and <li> elements?)

Glad to hear it's working, and hope you like the book.

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 April 20th, 2011, 02:04 PM
Registered User
 
Join Date: Apr 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am really enjoying the book. It's the first one on progamming I have that has really kept my interest and moving forward. It's kind of like drinking from a fire hose and I know I won't remember the details the first time though, but it's giving me good insight on how to approach a project, how a site is organized, and what can be done. I bought it in e-format and have it on my iPad, makes navigation, higlighting and searching very easy, and large text for my aging eyes helps!
 
Old April 21st, 2011, 02:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Good to hear you like the book so much. Spread the word, spread the word! ;-)

I recently purchased an iPad and was wondering how my book would look on it. Haven't had a chance to try it though, so it's good to hear it works well for you.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Different items in WebSiteMap and Menu AlexW ASP.NET 4 General Discussion 6 April 11th, 2011 12:26 PM
Blank items in menu ricardor ASP.NET 2.0 Basics 2 December 18th, 2009 06:08 AM
Chapter 7. Unable to get sub menu to display correctly digitalsoul BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 October 30th, 2009 03:37 PM
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
Menu Items JoBi C# 0 October 20th, 2004 08:51 PM





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