Wrox Programmer Forums
|
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
 
Old December 22nd, 2016, 09:00 PM
Registered User
 
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old December 27th, 2016, 07:14 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 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
__________________
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 December 27th, 2016, 03:38 PM
Registered User
 
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old December 27th, 2016, 03:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
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 December 27th, 2016, 03:56 PM
Registered User
 
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<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
 
Old December 27th, 2016, 04:08 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you upload it to a less dubious site? My firewall is blocking this site.

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 December 27th, 2016, 04:19 PM
Registered User
 
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Trying this website

http://s000.tinyupload.com/?file_id=...27578782331338

If this doesn't work, do you have any other suggestions?
 
Old December 27th, 2016, 04:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
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 December 27th, 2016, 04:47 PM
Registered User
 
Join Date: Dec 2016
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!
 
Old December 28th, 2016, 11:43 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Great, glad to hear it was an easy fix.

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
Site map menu and CSS markhh ASP.NET 4 General Discussion 9 August 3rd, 2011 05:39 PM
CHP 9 : Email issue: Smtp server returned an invalid response. Cooler BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 February 28th, 2011 01:38 PM
menu bar used in this site..!! krissh ASP.NET 2.0 Basics 4 August 4th, 2008 12:09 AM
adding images to the menu kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 September 18th, 2007 01:48 PM
Adding a menu to ChildWindow lmadhavi Visual C++ 2 August 31st, 2004 05:24 AM





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