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

December 22nd, 2016, 09:00 PM
|
|
Registered User
|
|
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chp 7 Try it Out Adding Menu to Site Issue
Hello, I'm working on Chapter 7 Try it Out Adding Menu to Site pg. 248:
My issue is that when I put the <asp:Menu ID="Menu1" runat="server" CssClass="MainMenu"> into the MasterPage, and go to Design, it says Root Node or Parent Node. Never says "Home" as the book states it should. When I take it a step further and change SiteMapDataSource>ShowStartingNode to False, it doesn't show all the menus, It just shows SIbling Node 1, current Node, Sibling Node 2, Sibling node 3. What's going on?
Code:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="~/" title="Home" description="Home">
<siteMapNode url="~/Default" title="Home" description="Go to the homepage" />
<siteMapNode url="~/Reviews/Default" title="Reviews" description="Reviews published on this site">
<siteMapNode url="~/Reviews/AllByGenre" title="By Genre" description="All Reviews Grouped by Genre" />
<siteMapNode url="~/Reviews/All" title="All Reviews" description="All Reviews" />
</siteMapNode>
<siteMapNode url="~/About/Default" title="About" description="About this Site">
<siteMapNode url="~/About/Contact" title="Contact Us" description="Contact Us" />
<siteMapNode url="~/About/AboutUs" title="About Us" description="About Us" />
</siteMapNode>
<siteMapNode url="~/Login" title="Login" description="Log in to this web site" />
</siteMapNode>
</siteMap>
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Frontend.master.cs" Inherits="MasterPages_Frontend" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<script src="/Scripts/modernizr-2.8.3.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div id="PageWrapper">
<header><a href ="/"></a></header>
<nav>
<asp:Menu ID="Menu1" runat="server" CssClass="MainMenu" DataSourceID="SiteMapDataSource1">
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
</nav>
<section id="MainContent">
<asp:ContentPlaceHolder ID ="cpMainContent" runat="server">
</asp:ContentPlaceHolder>
</section>
<aside id="Sidebar">
Select a Theme
<br />
<asp:DropDownList ID="ThemeList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ThemeList_SelectedIndexChanged">
<asp:ListItem>Monochrome</asp:ListItem>
<asp:ListItem>DarkGrey</asp:ListItem>
</asp:DropDownList>
</aside>
<footer>Footer Goes Here</footer>
</div>
</form>
</body>
</html>
Last edited by oIse7enIo; December 22nd, 2016 at 09:34 PM..
Reason: Add Code
|
|

December 27th, 2016, 07:14 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I tried your code on my copy of the Planet Wrox web site and it's working fine. What name did you give to the sitemap file? Did you store it in the root of the site?
Imar
|
|

December 27th, 2016, 03:38 PM
|
|
Registered User
|
|
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey Imar,
The Sitemap name is Web.sitemap
It's in the Site folder, it shows right under the Web.config folder, not in the config folder, just under it.
I can't seem to find a way to upload an image to the boards, but mine is showing "Parent Node" instead of Home, Reviews, By Genre, All Reviews.
Can't figure it out, been stuck on it for quite some time now.
Chris.
|
|

December 27th, 2016, 03:43 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Can you zip up the site, delete all irrelevant files that are not needed to reproduce the issue and then upload that zip somewhere? Then I'll take a look and see if I can figure it out.
Imar
|
|

December 27th, 2016, 03:56 PM
|
|
Registered User
|
|
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<a href=http://www.filedropper.com/begaspnet><img src=http://www.filedropper.com/download_button.png width=127 height=145 border=0/></a><br /><div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> <a href=http://www.filedropper.com >file upload storage</a></div>
I hope this is what you needed. This is all the files I've done up until this section. Hope this works, if not, here is a direct link:
http://www.filedropper.com/begaspnet
|
|

December 27th, 2016, 04:08 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Can you upload it to a less dubious site? My firewall is blocking this site.
Imar
|
|

December 27th, 2016, 04:44 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It works for me when I open the folder begASPNET\Site
Are you maybe opening begASPNET directly instead of the Site subfolder? Your App_Code and App_Themes folder in begASPNET seems to suggest so. Those folders should be in the same location as web.config and web.sitemap.
Hope this helps,
Imar
|
|

December 27th, 2016, 04:47 PM
|
|
Registered User
|
|
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I was opening the whole BegASP folder.
I wasn't just opening the site subfolder!
So I placed the App_Code and App_Themes into the Site Subfolder and opened the Site Subfolder and it's working!
Thank you so much!
|
|

December 28th, 2016, 11:43 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great, glad to hear it was an easy fix.
Imar
|
|
 |
|