1

私は私の中にこれを持っていますglobal.asax

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

    RegisterRoutes(RouteTable.Routes)

End Sub

Protected Shared Sub RegisterRoutes(ByVal routes As RouteCollection)

    ...        
    routes.MapPageRoute("aboutusRoute", "aboutus", "~/aboutus.aspx", True)
    routes.MapPageRoute("indexRoute", "index", "~/index.html", True)

    routes.MapPageRoute("archiveRoute", "archive/{year}/{month}","~/archive.aspx",True)
End Sub

次に、マスターページに次のマークアップがあります

<asp:SiteMapPath ID="SiteMapPath1" runat="server" Style="margin-left: 5px" ParentLevelsDisplayed="2" SiteMapProvider="SiteMapLinks">
                                    <PathSeparatorTemplate>
                                        <asp:Image ID="Image2" runat="server" ImageUrl="/chuktex/Images/Seperator.png"  style="margin-right:5px"/></PathSeparatorTemplate>
                                </asp:SiteMapPath>
                                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />

そして、私の中web.sitemapには次のものがあります

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

    <siteMapNode url="~/home" title="Home"  description="Home">
      .
      .
      .
       <siteMapNode url="~/systemmaint/" title="System Maintainance"  description="System Maintainance" />
      <siteMapNode url="~/Login/" title="Login"  description="Login" />
      <siteMapNode url="~/Profile/" title="Profile"  description="Profile" />
      <siteMapNode url="~/archive/" title="Archive"  description="Archive" />
      .
      .
      .
    </siteMapNode>

</siteMap>

systemmaint へのリンクをクリックすると、siteMapPath は正しく機能しましたが、アーカイブ リンクをクリックしても何も表示されませんでした。

4

1 に答える 1