使用<asp:SiteMapPath>
带有以下 Web.sitemap 文件的控件:
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:SiteMapPath ID="SiteMapPath1" runat="server"></asp:SiteMapPath>
<asp:Image ID="Image1" runat="server" ImageUrl="~/closed-sign.jpg" Height="300" Width="400" />
在运行时,它并没有向我展示它应该显示的方式,如本例所示。
它只显示图像,没有站点地图。
如何解决这个问题?
<?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="Home Page">
<siteMapNode url="StandardToolBox.aspx" title="Standard ToolBox Control" description="Standard ToolBox Control">
<siteMapNode url="BulletedList.aspx" title="BulltedList Example" description="BulltedList Control Simple Example" />
<siteMapNode url="CheckBox.aspx" title="CheckBox Example" description="CheckBox Control Simple Example" />
<siteMapNode url="CheckBoxList.aspx" title="CheckBoxList Example" description="CheckBoxList Control Simple Example" />
<siteMapNode url="Image.aspx" title="Image Control Example" description="Image Control Simple Example"/>
</siteMapNode>
<siteMapNode url="DataToolBox.aspx" title="Data ToolBox Control" description="Data ToolBox Control">
<siteMapNode url="SqlDataSource.aspx" title="SqlDataSource Example" description="SqlDataSource Simple Example" />
<siteMapNode url="XmlDataSource.aspx" title="XmlDataSource Example" description="XmlDataSource Simple Example" />
</siteMapNode>