Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 21st, 2009, 07:51 AM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 7 Home Link doesn't work

Hello

I know this problem is caused by having 2 default pages. When I navigate to home I get the following message

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Default.aspx

In the source page of About/Default.aspx It inherits="_Default". I think this is wrong as it refers to the Reviews/_Default.aspx. However when I change it to inherits= "Default" I get 19 build errors, the first one being 'Theme' is not a member of 'ASP.about_default_aspx'. C:\BegASPNET\Site\About\Default.aspx 1 .

I'm sure there is a simple solution, but I'm lost. I'd be very grateful for any advice.
 
Old April 21st, 2009, 12:07 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,

It's OK to have multiple Default pages. as long as they are in separate folders. So, I don't think that's the problem.

A 404 means that the page cannot be found. This seems to suggest the link to it is not OK. Can you post the code for the link that is broken, and explain how you request that page in the browser? E.g. http://localhost:1234 or http://localhost:1234/WebSite?

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 22nd, 2009, 05:18 AM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar

When I hit home on the horizontal menu and in tree view it requests http://localhost:4160/Default.aspx and I get the 404 message. In the breadcrumbs when I hit home it requests http://localhost:4160/ and I get the following

Directory Listing -- /

</SPAN> Tuesday, April 21, 2009 04:57 PM <dir> About Monday, April 20, 2009 01:08 PM <dir> App_Code Monday, April 06, 2009 12:53 PM <dir> App_Data Thursday, April 09, 2009 03:08 PM <dir> App_Themes Monday, April 06, 2009 12:58 PM <dir> Controls Tuesday, April 21, 2009 10:59 AM <dir> Demos Tuesday, April 21, 2009 10:45 AM <dir> MasterPages Tuesday, April 21, 2009 11:32 AM <dir> Reviews Thursday, April 09, 2009 02:36 PM <dir> Styles Thursday, April 09, 2009 09:43 AM 593 Login.aspx Wednesday, April 08, 2009 03:29 PM 179 Login.aspx.vb Thursday, April 09, 2009 02:29 PM 353 MyBasePage.aspx Thursday, April 09, 2009 02:29 PM 65 MyBasePage.aspx.vb Thursday, April 09, 2009 02:30 PM 349 TestPage.aspx Thursday, April 09, 2009 02:30 PM 63 TestPage.aspx.vb Monday, April 20, 2009 01:09 PM 10,001 web.config Tuesday, April 21, 2009 10:17 AM 1,015 Web.sitemapThis is the code for my masterpage<%@MasterLanguage="VB"CodeFile="MasterPage.master.vb"Inherits="MasterPage" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
htmlxmlns="http://www.w3.org/1999/xhtml">
<
headrunat="server">
<title></title>
<asp:ContentPlaceHolderid="head"runat="server">
</asp:ContentPlaceHolder>
</
head>
<
body>
<formid="form1"runat="server">
<divid="Pagewrapper">
<divid="Header"><aclass="HeaderLink"href="~/"runat="server">Header Goes Here</a></div>
<divid="MenuWrapper">
<asp:MenuID="Menu1"runat="server"CssClass="MainMenu"DataSourceID="SiteMapDataSource1"Orientation="Horizontal"StaticEnableDefaultPopOutImage="False">
<StaticSelectedStyleCssClass="StaticSelectedStyle"/>
<StaticMenuItemStyleCssClass="StaticMenuItemStyle"/>
<DynamicHoverStyleCssClass="DynamicHoverStyle"/>
<DynamicMenuItemStyleCssClass="DynamicMenuItemStyle"/>
<StaticHoverStyleCssClass="StaticHoverStyle"/>
</asp:Menu>
<asp:SiteMapDataSourceID="SiteMapDataSource1"runat="server"ShowStartingNode="False"/>
<asp:TreeViewID="TreeView1"runat="server"DataSourceID="SiteMapDataSource1"ShowExpandCollapse="False">
</asp:TreeView>
</div>
<divid="MainContent">
<asp:SiteMapPathID="SiteMapPath1"runat="server">
</asp:SiteMapPath><br/><br/>
<asp:ContentPlaceHolderID="cpMainContent"runat="server">
<p>
</p>
</asp:ContentPlaceHolder></div>
<divid="Sidebar">
Select a Theme
<asp:DropDownListID="FirstPreferredTheme"runat="server"AutoPostBack="True">
<asp:ListItem>Monochrome</asp:ListItem>
<asp:ListItem>DarkGrey</asp:ListItem>
</asp:DropDownList>
</div>
<divid="Footer">Footer Goes Here</div>
</div>
</form>
</
body>
</
html>

This is my site map

<?xmlversion="1.0"encoding="utf-8" ?>
<
siteMapxmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<
siteMapNodeurl="~/"title="Home"description="Home">
<
siteMapNodeurl="~/Default.aspx"title="Home"description="Go to the homepage" />
<
siteMapNodeurl="~/Reviews/Default.aspx"title="Reviews"description="Reviews published on this site">
<
siteMapNodeurl="~/Reviews/AllByGenre.aspx"title="By Genre"description="All Reviews Grouped by Genre" />
<
siteMapNodeurl="~/Reviews/All.aspx"title="All Reviews"description="All Reviews" />
</
siteMapNode>
<
siteMapNodeurl="~/About/Default.aspx"title="About"description="About this Site">
<
siteMapNodeurl="~/About/Contact.aspx"title="Contact Us"description="Contact Us" />
<
siteMapNodeurl="~/About/AboutUs.aspx"title="About Us"description="About Us" />
</
siteMapNode>
<
siteMapNodeurl="~/Login.aspx"title="Login"description="Log in to this web site" />
</
siteMapNode>
</
siteMap>

Thanks
 
Old April 22nd, 2009, 02:34 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 could be wrong (as the code you posted is quite messy) but it looks like you simple don't have a Default.aspx in the root in your site.

Do you see that page in the Solution Explorer in VWD?

Also, what's MyBasePage.aspx doing there? BasePage should be a class file in App_Code...

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!
The Following User Says Thank You to Imar For This Useful Post:
tornface (April 23rd, 2009)
 
Old April 23rd, 2009, 04:18 AM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar
Thanks very much. I knew it would be simple. I had moved my original default into /about. It's all working now. Thanks for your time, I was just about to throw in the towel.
 
Old April 23rd, 2009, 11: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

You're welcome....

That's what these forums are about: preventing you from throwing in the towel.... ;-)

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
Trying to figure out how to work a link issue gene4455 VBScript 0 October 22nd, 2008 12:06 PM
How to Link User control Form to Home page Dhanapal ASP.NET 1.0 and 1.1 Basics 1 March 12th, 2007 05:30 PM
File Link Won't Work Ron Howerton ASP.NET 1.0 and 1.1 Basics 13 November 3rd, 2006 12:54 PM





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