473,626 Members | 3,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I create a navigation bar accross the top of the page?

I want to create a top navigation bar:

Home Products Services About Contact
>Product A
Product B
I have been trying to use web.sitemap as the source for a menu control as
show in the example:

<?xml version="1.0" encoding="utf-8" ?>

<siteMap>
<siteMapNode title="Home" description="Ho me" url="~/default.aspx">
<siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">
<siteMapNode title="Training " description="Tr aining classes"
url="~/Training.aspx" />
<siteMapNode title="Consulti ng" description="Co nsulting
services"
url="~/Consulting.aspx " />
<siteMapNode title="Support" description="Su pports plans"
url="~/Support.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >

<!-- For the hover styles of the Menu control to -->
<!-- work correctly, you must include this head -->
<!-- element. -->
<head id="Head1" runat="server">
<title>Menu DataBinding Example</title>
</head>

<body>
<form id="form1" runat="server">

<h3>Menu DataBinding Example</h3>

<!-- Bind the Menu control to a SiteMapDataSour ce control. -->
<asp:menu id="NavigationM enu"
disappearafter= "2000"
staticdisplayle vels="2"
staticsubmenuin dent="10"
orientation="Ve rtical"
font-names="Arial"
target="_blank"
datasourceid="M enuSource"
runat="server">

<staticmenuitem style backcolor="Ligh tSteelBlue"
forecolor="Blac k"/>
<statichoversty le backcolor="Ligh tSkyBlue"/>
<dynamicmenuite mstyle backcolor="Blac k"
forecolor="Silv er"/>
<dynamichoverst yle backcolor="Ligh tSkyBlue"
forecolor="Blac k"/>

</asp:menu>

<asp:SiteMapDat aSource id="MenuSource "
runat="server"/>

</form>
</body>
</html>
This and other examples I have tried don't show it the way I illustrated at
the top of this email; they always seem to have the Home link as the focal
point. When I try to amend the web.sitemap to include another top-level
siteMapNode next to Home (e.g. Products) the XML gives an error.

Any idea why this is?

TIA

Jul 8 '08 #1
3 1953


"Mark B" <no*****@none.c omwrote in message
news:ey******** ******@TK2MSFTN GP02.phx.gbl...
I want to create a top navigation bar:

Home Products Services About Contact
>Product A
>Product B

I have been trying to use web.sitemap as the source for a menu control as
show in the example:

<?xml version="1.0" encoding="utf-8" ?>

<siteMap>
<siteMapNode title="Home" description="Ho me" url="~/default.aspx">
<siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">
<siteMapNode title="Training " description="Tr aining classes"
url="~/Training.aspx" />
<siteMapNode title="Consulti ng" description="Co nsulting
services"
url="~/Consulting.aspx " />
<siteMapNode title="Support" description="Su pports plans"
url="~/Support.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >

<!-- For the hover styles of the Menu control to -->
<!-- work correctly, you must include this head -->
<!-- element. -->
<head id="Head1" runat="server">
<title>Menu DataBinding Example</title>
</head>

<body>
<form id="form1" runat="server">

<h3>Menu DataBinding Example</h3>

<!-- Bind the Menu control to a SiteMapDataSour ce control. -->
<asp:menu id="NavigationM enu"
disappearafter= "2000"
staticdisplayle vels="2"
staticsubmenuin dent="10"
orientation="Ve rtical"
font-names="Arial"
target="_blank"
datasourceid="M enuSource"
runat="server">

<staticmenuitem style backcolor="Ligh tSteelBlue"
forecolor="Blac k"/>
<statichoversty le backcolor="Ligh tSkyBlue"/>
<dynamicmenuite mstyle backcolor="Blac k"
forecolor="Silv er"/>
<dynamichoverst yle backcolor="Ligh tSkyBlue"
forecolor="Blac k"/>

</asp:menu>

<asp:SiteMapDat aSource id="MenuSource "
runat="server"/>

</form>
</body>
</html>
This and other examples I have tried don't show it the way I illustrated
at the top of this email; they always seem to have the Home link as the
focal point. When I try to amend the web.sitemap to include another
top-level siteMapNode next to Home (e.g. Products) the XML gives an error.

Any idea why this is?
Home is the focal point, because in your XML. Home is a top level node and
it has got childs.

As an idea, you need to modify your sitemap XML like this

<siteMapNode title="Home" description="Ho me" url="~/default.aspx" / <!--
Note the ending tag here -->
<siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">
--
Madhur
Jul 8 '08 #2
I get :

"Parser Error Message: The XML sitemap config file web.sitemap could not be
loaded. The 'siteMap' start tag on line 3 does not match the end tag of
'siteMapNode'. Line 21, position 7.


"Madhur" <sd*@df.comwrot e in message
news:3B******** *************** ***********@mic rosoft.com...
>

"Mark B" <no*****@none.c omwrote in message
news:ey******** ******@TK2MSFTN GP02.phx.gbl...
>I want to create a top navigation bar:

Home Products Services About Contact
> >Product A
>Product B

I have been trying to use web.sitemap as the source for a menu control as
show in the example:

<?xml version="1.0" encoding="utf-8" ?>

<siteMap>
<siteMapNode title="Home" description="Ho me" url="~/default.aspx">
<siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">
<siteMapNode title="Training " description="Tr aining classes"
url="~/Training.aspx" />
<siteMapNode title="Consulti ng" description="Co nsulting
services"
url="~/Consulting.aspx " />
<siteMapNode title="Support" description="Su pports plans"
url="~/Support.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >

<!-- For the hover styles of the Menu control to -->
<!-- work correctly, you must include this head -->
<!-- element. -->
<head id="Head1" runat="server">
<title>Menu DataBinding Example</title>
</head>

<body>
<form id="form1" runat="server">

<h3>Menu DataBinding Example</h3>

<!-- Bind the Menu control to a SiteMapDataSour ce control. -->
<asp:menu id="NavigationM enu"
disappearafter= "2000"
staticdisplayle vels="2"
staticsubmenuin dent="10"
orientation="Ve rtical"
font-names="Arial"
target="_blank"
datasourceid="M enuSource"
runat="server">

<staticmenuitem style backcolor="Ligh tSteelBlue"
forecolor="Blac k"/>
<statichoversty le backcolor="Ligh tSkyBlue"/>
<dynamicmenuite mstyle backcolor="Blac k"
forecolor="Silv er"/>
<dynamichoverst yle backcolor="Ligh tSkyBlue"
forecolor="Blac k"/>

</asp:menu>

<asp:SiteMapDat aSource id="MenuSource "
runat="server"/>

</form>
</body>
</html>
This and other examples I have tried don't show it the way I illustrated
at the top of this email; they always seem to have the Home link as the
focal point. When I try to amend the web.sitemap to include another
top-level siteMapNode next to Home (e.g. Products) the XML gives an
error.

Any idea why this is?

Home is the focal point, because in your XML. Home is a top level node and
it has got childs.

As an idea, you need to modify your sitemap XML like this

<siteMapNode title="Home" description="Ho me" url="~/default.aspx" />
<!-- Note the ending tag here -->
> <siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">

--
Madhur

Jul 8 '08 #3
And if I delete that last / I get:

"Exactly one <siteMapNodeele ment is required directly inside the <siteMap>
element. "
"Madhur" <sd*@df.comwrot e in message
news:3B******** *************** ***********@mic rosoft.com...
>

"Mark B" <no*****@none.c omwrote in message
news:ey******** ******@TK2MSFTN GP02.phx.gbl...
>I want to create a top navigation bar:

Home Products Services About Contact
> >Product A
>Product B

I have been trying to use web.sitemap as the source for a menu control as
show in the example:

<?xml version="1.0" encoding="utf-8" ?>

<siteMap>
<siteMapNode title="Home" description="Ho me" url="~/default.aspx">
<siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">
<siteMapNode title="Training " description="Tr aining classes"
url="~/Training.aspx" />
<siteMapNode title="Consulti ng" description="Co nsulting
services"
url="~/Consulting.aspx " />
<siteMapNode title="Support" description="Su pports plans"
url="~/Support.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >

<!-- For the hover styles of the Menu control to -->
<!-- work correctly, you must include this head -->
<!-- element. -->
<head id="Head1" runat="server">
<title>Menu DataBinding Example</title>
</head>

<body>
<form id="form1" runat="server">

<h3>Menu DataBinding Example</h3>

<!-- Bind the Menu control to a SiteMapDataSour ce control. -->
<asp:menu id="NavigationM enu"
disappearafter= "2000"
staticdisplayle vels="2"
staticsubmenuin dent="10"
orientation="Ve rtical"
font-names="Arial"
target="_blank"
datasourceid="M enuSource"
runat="server">

<staticmenuitem style backcolor="Ligh tSteelBlue"
forecolor="Blac k"/>
<statichoversty le backcolor="Ligh tSkyBlue"/>
<dynamicmenuite mstyle backcolor="Blac k"
forecolor="Silv er"/>
<dynamichoverst yle backcolor="Ligh tSkyBlue"
forecolor="Blac k"/>

</asp:menu>

<asp:SiteMapDat aSource id="MenuSource "
runat="server"/>

</form>
</body>
</html>
This and other examples I have tried don't show it the way I illustrated
at the top of this email; they always seem to have the Home link as the
focal point. When I try to amend the web.sitemap to include another
top-level siteMapNode next to Home (e.g. Products) the XML gives an
error.

Any idea why this is?

Home is the focal point, because in your XML. Home is a top level node and
it has got childs.

As an idea, you need to modify your sitemap XML like this

<siteMapNode title="Home" description="Ho me" url="~/default.aspx" />
<!-- Note the ending tag here -->
> <siteMapNode title="Products " description="Ou r products"
url="~/Products.aspx">
<siteMapNode title="Hardware " description="Ha rdware choices"
url="~/Hardware.aspx" />
<siteMapNode title="Software " description="So ftware choices"
url="~/Software.aspx" />
</siteMapNode>
<siteMapNode title="Services " description="Se rvices we offer"
url="~/Services.aspx">

--
Madhur

Jul 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3921
by: Dave Patton | last post by:
Using my About page as an example: http://members.shaw.ca/davepatton/about.html What is the best/proper way to markup a page such as this that has "the main body" and "a navigation menu"? It has been suggested before that I should have the navigation menu at the end of the HTML, so that a screen reader doesn't have to read it to get to the content, with the possible exception of having
0
2123
by: Veli-Pekka Tätilä | last post by:
Hi, My first post here. I've found some serious accessibility flaws in the Python 2.4 docs and wish they could be rectified over time. I'm very new to Python and initially contacted docs at python org, However, I haven't gotten a reply for a week or so, and figured out I could post here for a larger audience, then. Original message follows: Hello,
1
1074
by: David | last post by:
control? I am talking about a tab control with links to a bunch of pages which could be on the left side or accross the top of the page. I've used user controls, but having to put the user control on every page is getting tiresome. Is using frames a better way? Then if so, how would you do that? Server.Transfer() does not let me specify the target frame and neither does
4
2609
by: Pål Andreassen | last post by:
We are using a TreeView defined in a MasterPage for navigation. The tree holds it's state turing postbacks just fine since it's using viewstate. But whenever a node click results in a redirect to a new content page the tree state is lost and the tree needs to be re-initialized. Any tips on how to retain the state of the three also during non post-back or requests (GET requests or Response.Redirect). Some how I need to store the whole...
28
2672
by: laredotornado | last post by:
Hi, Surprisingly, I can't get the drop down menus to work on PC IE 6. If you roll over "PRODUCTS", normally a drop down menu appears (on Safari and Firefox), but on PC IE, nada. http://test2.boxxtech.com/corporate/test.asp Any ideas? Thanks, - Dave
8
20353
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1: Start with original thumbnails & two empty sub directories STEP 2: Create smaller versions of the originals for one sub directory STEP 3: Create thumbnail version of the originals the other sub directory STEP 4: Create an index.html pointing to the...
0
1150
by: islandfong | last post by:
I am a beginner in ASP.NET. I am trying to use Master page to create the navigation tree. I can create the navigation tree of the header. but how can I created the navigation tree on the left hand side? Anybody has any sample code to share? Thanks.
3
2525
by: Raphas | last post by:
Hi, there are a lot of different scripts out there to sort a table with multiple columns. However, I want to do something specific. I have a table that is "spread" accross multiple pages. Usually, when a user wants to change the page, what you do is compute indexes in the server and return the modified list. But that's not what I want to do, I want to be able to navigate through the pages AND be able to sort the columns within the...
10
2541
by: EA | last post by:
I am sure I must be missing something about building navigation bars with CSS. Yes it is a very clever and efficient way to format navigation structures on simple one navigation level webs, i.e. six buttons which when clicked go to a separate web page. But here is where I must be missing something, am I right in thinking that if you wish to have nested navigation structures then each individual page of the web site must have a different...
0
8272
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8205
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8644
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8514
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7206
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.