Wrox Programmer Forums

Need to download code?

View our list of code downloads.

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
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 28th, 2019, 09:42 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2019
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default Chapter 7. Menu CSS Styling not working

Hi Imar
Having an Issue with the CSS styling. Have replaced my CSS File with the downloaded one and still the Background colors are not being picked up from the CSS. Its as though the original .MainMenu class is overriding the additional styling. Have I missed a properties grid item?ShowStaringNode False, StaticEnableDefaultPopOutImage False, Orientation Horizonatal.

Another Step I must have missed somewhere. When Creating the about.aspx ect files the .cs file is defaulting to : System.Web.UI.Page and not : BasePage. Easy to fix but I'm sure it should pick that up automatically.

Yours
Philip Bailey
Reply With Quote
  #2 (permalink)  
Old April 29th, 2019, 10:11 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Philip,

Can you post a zipped copy of your site somewhere? (Dropbox, or something similar) and explain which page or what is misbehaving exactly and how (page / step number and so on would help a lot)?

>> Easy to fix but I'm sure it should pick that up automatically.

Sounds like add a new Web Form using the standard template and you didn't pick your custom template.

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!
Reply With Quote
  #3 (permalink)  
Old April 29th, 2019, 11:54 AM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2019
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar
Here is the link to the zipped site on OneDrive.

https://1drv.ms/f/s!Avw4ZelhChRbgaJGRGO3xWrYF_c54g

Isue is the BackColor is not working have checked all the code and even changed from the version of the Monochrome CSS file that I keyed to the one from the Chapter 7 Downloads and still it's not working.
Page No. 252 Step 4 - 253 Figure 7-8.

In the Same folder as the zip there are two image files
One a screen shot of the resulting menu CSS not working
It's as though the CSS is being overridden by some other command.

The second a Screen Shot of newly created Default2.aspx.cs showing the resulting output that requires and edit. Note I have included the exported Page Template Zip also with a text file giving it's local path on my machine. This relates to Step 3 on Page 252
It requires a change of the Inherit : Page as shown to ": BasePage" Where did I go wrong on error 2 and how do I fix it?

Much obliged.
Yours
Philip Bailey
Reply With Quote
  #4 (permalink)  
Old April 29th, 2019, 12:30 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2019
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default Issue One: Partially Solved

Hi Imar
Don't think it's the site code after all. Trying lots of things and one worked. My Default browser is Google Chrome Copied the URL into MS Edge, did a postback and everything worked. Gone through all my settings for chrome but cannot find what is blocking these CSS Commands. Any suggestions?

Yours
Philip Bailey
Reply With Quote
  #5 (permalink)  
Old April 29th, 2019, 12:45 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2019
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default Issue One: Partially Solved Update

Hi Imar
Have found several posts with regard to the following browsers
Google Chrome and Apple Safari, when displaying ASP:Menu Controls and not rendering correctly.

There are several solutions it seems one example is this code into the Master Page.

protected override void AddedControl(Control control, int index)
{
if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)
{
this.Page.ClientTarget = "uplevel";
}
base.AddedControl(control, index);

Another simpler One

if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
{
Request.Browser.Adapters.Clear();
}
}

Source: https://www.codeproject.com/Question...es-not-display
Reply With Quote
  #6 (permalink)  
Old April 29th, 2019, 01:19 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2019
Posts: 10
Thanks: 0
Thanked 1 Time in 1 Post
Default Issue One: Partially Solved Update

Hi Imar
The code snippets don't fix the problem. Have bit the bullet and switched my default browser to MS Edge. All working as expected.
However this does raise the issue that ASP:Menu may not be the best options for a production site as it is not well handled by it seems from posts Chrome, Safari and Opera.

Have you any suggestions on this?

Well back to my study moving on in Chapter 7.
Yours
Philip Bailey
Reply With Quote
  #7 (permalink)  
Old April 30th, 2019, 06:51 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Do the menus look OK on this site? http://www.planetwrox.com/

Maybe it was just the cache? Have you tried clearing your browser's cache?
__________________
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!
Reply With Quote
  #8 (permalink)  
Old April 30th, 2019, 07:03 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

BTW:

>> It requires a change of the Inherit : Page as shown to ": BasePage" Where did I go wrong on error 2 and how do I fix it?

The template you sent me looks good as it his this code:

public partial class $relurlnamespace$_$safeitemname$ : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{

}
}

Are you sure you're picking your custom template and not the built-in Web Forms one?
__________________
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!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 Styling the Menu Control fanwu0124 BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 6 August 12th, 2015 07:20 AM
Chapter 3 - Try it out - Styling PW Homepage mohamad BOOK: Beginning ASP.NET 4.5 : in C# and VB 2 June 23rd, 2014 11:56 AM
Chapter 7 Styling the Menu honzabilek4 BOOK: Beginning ASP.NET 4.5 : in C# and VB 2 June 15th, 2014 10:40 AM
Styling the Menu Control stephenf BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 March 17th, 2009 02:41 PM



All times are GMT -4. The time now is 06:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.