我用我的 default.aspx 页面创建了一个站点地图,对其进行了相应的编码,然后在页面中添加了一个站点地图数据源控件和一个树视图控件。然后,我通过添加“datasourceID”来更改树视图的代码以链接到站点地图数据源。但是,在浏览器中查看页面时,我仍然遇到错误,不知道还能做什么。帮助将不胜感激。谢谢你。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" BackColor="#DFDFFF" Font-Names="Arial"
Font-Size="Medium" Height="557px" Width="913px">
<asp:Panel ID="Panel2" runat="server" Width="223px" BackColor="#3333CC"
ForeColor="White"
style="top: 58px; left: 10px; position: absolute; height: 437px; margin-top: 70px; text-align: center;">
<asp:Panel ID="Panel3" runat="server" BackColor="#003399" ForeColor="White"
style="margin-left: 259px; top: -109px; left: -258px; position: absolute; width: 906px; height: 105px;">
<asp:Label ID="Label1" runat="server" Font-Size="XX-Large"
style="z-index: 1; left: 293px; top: 33px; position: absolute; width: 345px; text-align: center;"
Text="Web Page Header"></asp:Label>
</asp:Panel>
<asp:Label ID="Label2" runat="server" Font-Bold="True" ForeColor="White"
style="z-index: 1; left: 56px; top: 7px; position: absolute; width: 99px"
Text="Menu"></asp:Label>
<br />
<br />
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1">
</asp:TreeView>
</asp:Panel>
</asp:Panel>
</div>
</form>
</body>
</html>
站点地图代码:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="this is the home page">
<siteMapNode url="Aboutus.aspx" title="About us" description="this is the contact page" />
<siteMapNode url="Contactus.aspx" title="Contact Us" description="this is the whatever page" />
<siteMapNode url="History.aspx" title="Our History" description="this is the whatever page" />
</siteMapNode>
</siteMap>