Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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 October 29th, 2010, 06:52 AM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default Horizontal Menu made in asp.net 4 running on 3.5 server

Hi all,

Are there any differences in the menu code from 3.5 to 4? I have been working through the book and at the same time developing my own site. The menu I created works fine when debugged from my own machine but not when I ftp to a 3.5 site I have.

Any thoughts?

Regards

Lee
 
Old October 29th, 2010, 07:44 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 Lee,

Yes, it's quite different. In .NET 3.5, a table based structure was used. In .NET 4, the menu is built with <ul> and <li> elements. You can tell .NET 4 to render the menu the way it did in 3.5, but not the other way around.

You can render as 3.5 in 4.0 by modifying the <pages /> element in web.config as follows:

Code:
 
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
Hope this helps,

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 October 29th, 2010, 12:06 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Many thanks for your reply. I already have this piece of code in the web.config file. This is what I have:

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
</configuration>

Regards

Lee Warren
 
Old October 29th, 2010, 12:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And does it work now?

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 October 29th, 2010, 12:18 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

No - I had that line of code in from the beginning.
 
Old October 29th, 2010, 12:32 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

This is my code for the menu

<div id="Navigation">
<asp:Menu ID="Menu1" runat="server" CssClass="MainMenu" DataSourceID="SiteMapDataSource1"
Orientation="Horizontal" StaticSubMenuIndent=""
MaximumDynamicDisplayLevels="2" StaticEnableDefaultPopOutImage="False">
<DynamicHoverStyle BackColor="#FF9900" Font-Names="Verdana" Font-Size="16px"
Height="30px" CssClass="NavAlign" />
<DynamicMenuItemStyle Height="30px" CssClass="NavAlign" />
<DynamicMenuStyle Height="60px" HorizontalPadding="5px" />
<DynamicSelectedStyle Height="30px" />
<StaticHoverStyle BackColor="#FF9933" />
<StaticMenuItemStyle Font-Names="Verdana" Height="30px"
VerticalPadding="10px" />
<StaticMenuStyle BackColor="White" CssClass="MainMenu" Height="30px"
HorizontalPadding="1px" VerticalPadding="1px" />
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" />
</div>
 
Old October 29th, 2010, 12:34 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

See it here at www.bestrong.org.uk/default.aspx
 
Old October 29th, 2010, 01:47 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

Actually....

I have the start Options under the WebSite menu set to Target Framework 3.5

If I don't have this set like this, then the website when uploaded shows an error.

Is this complicating things and should I start again?

Regards

Lee
 
Old October 29th, 2010, 01:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Is this complicating things and should I start again?
No, if your final server only has .NET 3.5, you *need* this setting in order to make the site run on .NET 3.5

With regard to the menu: check its final HTML and see if you can find a difference between the one that works and the one that doesn't.

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 October 29th, 2010, 02:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just realized this may not be related to 3.5 versus 4, but about IE8 versus ASP.NET. Maybe this helps: IE8 and the Menu ?

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
specified web server is not running ASP.NET 1.1 anujrathi ASP.NET 1.0 and 1.1 Professional 2 August 15th, 2007 12:48 PM
Asp.Net 2 Horizontal Menu Display Problem ivotive ASP.NET 2.0 Professional 1 December 15th, 2006 04:28 AM
"Server not running ASP.NET 1.1" error message arashj General .NET 1 September 7th, 2004 05:49 AM
server is not running ASP.NET version 1.1 akthar General .NET 1 August 23rd, 2004 06:23 AM
Changing Menu made with VB 4 Menu Editor Zooker VB How-To 1 July 26th, 2003 11:44 PM





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