Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET 4 : in C# and VB
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 26th, 2011, 02:54 AM
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu server control not correctly shows up

HI I am experimenting Menu server control

I have the Web.sitemap file with content:

I drag-dropped the SiteMapDataSource. If I am correct, it directly connects to the .sitemap file (as I did this for TreeView earlier, it worked)

Then I drag-dropped Menu server control, set its datadource to above SiteMapDataSource & hit F5. But did not showed up the content in .sitemap
as a hierarchy that unfolds on hovering, but showed all the contents statically on the page:

crome snapshot: http://img707.imageshack.us/img707/2044/aspnetmenu.png

however Visual Studio shows it up correctly in the design view:

Why is this?

ASPX code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
Web.sitemap content:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode title="Home" description="Home Page" url="Default.aspx">
    <siteMapNode title="News" description="The Latest News" url="News.aspx">
      <siteMapNode title="U.S." description="U.S. News"
      url="News.aspx?cat=us" />
      <siteMapNode title="World" description="World News"
      url="News.aspx?cat=world" />
      <siteMapNode title="Technology" description="Technology News"
      url="News.aspx?cat=tech" />
      <siteMapNode title="Sports" description="Sports News"
      url="News.aspx?cat=sport" />
    <siteMapNode title="Finance" description="The Latest Financial Information"
      <siteMapNode title="Quotes" description="Get the Latest Quotes"
      url="Quotes.aspx" />
      <siteMapNode title="Markets" description="The Latest Market Information"
        <siteMapNode title="U.S. Market Report"
        description="Looking at the U.S. Market" url="MarketsUS.aspx" />
        <siteMapNode title="NYSE"
        description="The New York Stock Exchange" url="NYSE.aspx" />
      <siteMapNode title="Funds" description="Mutual Funds"
      url="Funds.aspx" />
    <siteMapNode title="Weather" description="The Latest Weather"
    url="Weather.aspx" />
  #2 (permalink)  
Old September 13th, 2011, 02:17 PM
Friend of Wrox
Points: 547, Level: 8
Points: 547, Level: 8 Points: 547, Level: 8 Points: 547, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts

Hi Mahesha
If you need only show breadcrumb( sitemappath) navigation, You need not to specify sitemap file in sitemapdatasource and asp.net find it automatically.
However if you use TreeView or Menu Control You must specify sitemap address in sitemapdatasource control.
Please excuse me for poor and bad English.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Menu Items not Formatting Correctly WHixson BOOK: Beginning ASP.NET 4 : in C# and VB 5 April 21st, 2011 02:58 AM
Chapter 7. Unable to get sub menu to display correctly digitalsoul BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 October 30th, 2009 03:37 PM
Need help understanding why user control shows snufse ASP.NET 2.0 Basics 0 May 12th, 2009 09:43 AM
doubt on menu server control nityasjohn ASP.NET 2.0 Basics 1 July 30th, 2007 01:43 PM
So that Menu shows only subnodes of a node itself KamalRaturi ASP.NET 2.0 Professional 0 October 14th, 2006 09:26 AM

All times are GMT -4. The time now is 09:10 AM.

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