Hi,
1.Please check the users.aspx page is in the root directory, "~" represents the root directory. If the path is not corrrect, the error message will be thrown when you compile the application.
Belwo is my test code by refering the MSDN article, during i create this test application, I met the same problem as you can, the cause of the problem is path of the page is not corrent, make the second sitemapdatasource's StartingNodeUrl as the same as the sitemapnode's, and the check the page can be found by using this path.
Now the below code, works fine on my local machine:
1. the aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Menu_Cases_Cases_twomenu_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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"
MaximumDynamicDisplayLevels="0" onmenuitemclick="Menu1_MenuItemClick"
Orientation="Horizontal">
<DataBindings>
<asp:MenuItemBinding DataMember="SiteMapNode" TextField="Title" />
</DataBindings>
</asp:Menu>
</div>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" />
<br />
<br />
<br />
<asp:Menu ID="Menu2" runat="server" DataSourceID="SiteMapDataSource2"
onmenuitemclick="Menu2_MenuItemClick" Orientation="Horizontal">
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource2" runat="server"
EnableViewState="False" StartingNodeOffset="-1"
StartingNodeUrl="~/Menu/Cases/Cases/twomenu/Default.aspx?node=hardware" />
</form>
</body>
</html>
2. the codebehind:
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
switch (e.Item.Value)
{
case "Products":
SiteMapDataSource2.StartingNodeUrl = "Default.aspx?node=hardware";
return;
case "Services":
SiteMapDataSource2.StartingNodeUrl = "Default.aspx?node=consulting";
return;
case "Support":
SiteMapDataSource2.StartingNodeUrl = "Default.aspx?node=drivers";
return;
}
}
3. the sitemap file:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode title="Home">
<siteMapNode title="Products">
<siteMapNode title="Hardware" url="~/Menu/Cases/Cases/twomenu/Default.aspx?node=hardware">
<siteMapNode title="Mouse"/>
<siteMapNode title="Keyboard"/>
<siteMapNode title="NetCard"/>
<siteMapNode title="Monitor"/>
<siteMapNode title="PC"/>
</siteMapNode>
<siteMapNode title="Software" url="Default.aspx?node=software">
<siteMapNode title="Spreadsheet"/>
<siteMapNode title="Word Processor"/>
<siteMapNode title="Presentation"/>
<siteMapNode title="Mail"/>
<siteMapNode title="Games"/>
</siteMapNode>
<siteMapNode title="Books" url="Default.aspx?node=books">
<siteMapNode title="Programming"/>
<siteMapNode title="Debugging"/>
<siteMapNode title="Testing"/>
<siteMapNode title="Web Apps"/>
<siteMapNode title="WinForm Apps"/>
</siteMapNode>
</siteMapNode>
<siteMapNode title="Services">
<siteMapNode title="Consulting" url="Default.aspx?node=consulting">
<siteMapNode title="Processes"/>
<siteMapNode title="Management"/>
<siteMapNode title="Recruiting"/>
</siteMapNode>
<siteMapNode title="Development" url="Default.aspx?node=development">
<siteMapNode title="Web Apps"/>
<siteMapNode title="Enterprise Apps"/>
<siteMapNode title="Database"/>
</siteMapNode>
</siteMapNode>
<siteMapNode title="Support">
<siteMapNode title="Drivers" url="Default.aspx?node=drivers">
<siteMapNode title="Audio"/>
<siteMapNode title="Network"/>
<siteMapNode title="Printer"/>
<siteMapNode title="Modem"/>
</siteMapNode>
<siteMapNode title="Manuals" url="Default.aspx?node=manuals">
<siteMapNode title="Applications"/>
<siteMapNode title="Troubleshooting"/>
<siteMapNode title="Installation"/>
<siteMapNode title="Internet"/>
</siteMapNode>
<siteMapNode title="Updates" url="Default.aspx?node=updates">
<siteMapNode title="Release 1"/>
<siteMapNode title="Game Package"/>
</siteMapNode>
</siteMapNode>
</siteMapNode>
</siteMap>
Hope it helps.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Yours sincerely,
Amanda Wang
Microsoft Online Community Support