 |
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
|
|
|
|
|

April 19th, 2011, 08:03 AM
|
|
Authorized User
|
|
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
ASP Menu appears as links
I used the default ASP.NET menu that is present when you start a new Web Site project and just modified colours in CSS. While viewing online it changes to simple links?
Hosting support said I was using .axd files for the menu and because it was running in faster integrated pipeline mode, advised adding this to web.config:
<handlers>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD"
path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</handlers>
- but this hasnt fixed it, I have tried browsing with IE, Firefox, Safari, & Chrome.
Anyone have any ideas? www.golfingnetwork.co.uk
|
|

April 20th, 2011, 02:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Alex,
That version number doesn't look right to me. Looks like an earlier number of the web extensions.
Are you sure they configured the site for ASP.NET 4 correctly? Is there an on-line version I can look at?
Cheers,
Imar
|
|

April 20th, 2011, 07:45 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Can you post the code for the web.config at the hosting server (make sure you remove stuff like passwords).
Cheers,
Imar
|
|

April 20th, 2011, 08:47 AM
|
|
Authorized User
|
|
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Appreciate your help Imar:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<clear />
<add name="ApplicationServices" connectionString="Data Source=mssql4.websitelive.net;Initial Catalog=GolfingNetwork;User Id=*****;Password=******;" providerName="System.Data.SqlClient" />
<add name="ConnectionString" connectionString="Data Source=mssql4.websitelive.net;Initial Catalog=GolfingNetwork;User Id=*****;Password=*****;" providerName="System.Data.SqlClient" />
</connectionStrings>
<!-- Email setup -->
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="Golfing Network <[email protected]>">
<network host="mail.WebSiteLive.net" port="25" userName="*****" password="*****" />
</smtp>
</mailSettings>
</system.net>
<!-- General settings -->
<appSettings>
<add key="FromAddress" value="[email protected]" />
<add key="FromName" value="GolfingNetwork.co.uk" />
<add key="MessageSubject" value="Welcome to GolfingNetwork.co.uk (Do Not Reply)" />
<add key="SendMailOnError" value="true" />
</appSettings>
<system.web>
<customErrors mode="On"></customErrors>
<siteMap defaultProvider="SMPSiteMap" enabled="true">
<providers>
<add name="MenuSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Menu.sitemap" />
<add name="SMPSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/SMP.sitemap" />
</providers>
</siteMap>
<compilation debug="false" strict="false" explicit="true" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<handlers>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="false" />
<defaultDocument>
<files>
<clear />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="default.aspx" />
<add value="index.php" />
<add value="_holding.htm" />
</files>
</defaultDocument>
</system.webServer>
<!-- Restrict access -->
<location path="MyGolfingNetwork">
<system.web>
<authorization>
<allow roles="Managers" />
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="Management">
<system.web>
<authorization>
<allow roles="Managers" />
<deny users="*" />
</authorization>
</system.web>
</location>
</configuration>
|
|

April 20th, 2011, 09:12 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You seem to be missing the targetFramework:
Code:
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
To see what else might be missing, choose File | New Web Site in VS 2010 and then compare the resulting web.config with yours.
Hope this helps,
Imar
|
|

April 20th, 2011, 10:57 AM
|
|
Authorized User
|
|
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
After adding targetFramework="4.0" so my line is:
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0"/>
it errors saying:
Unrecognized attribute 'targetFramework'
|
|

April 20th, 2011, 11:03 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Then your host hasn't configured your site in IIS for .NET 4. You'll need to work with them (or use a Control Panel if they have one) to properly configure it.
Cheers,
Imar
|
|

April 20th, 2011, 02:04 PM
|
|
Authorized User
|
|
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Do'h! The site was set to 2.0 in the control panel. Thanks for the help.
|
|
 |
|