Introduction
The SiteMapPath control is a navigation control that allows the user to know the current page location with respect to the home page. |
Steps :
Just follow the steps and get result easily.Step - 1 : Create New Project
Go to File > New > Project > Select asp.net mvc4 web application > Entry Application Name > Click OK.Step-2: Add some pages to project.
Go to Solution Explorer > Right Click on Project > Add > New item > Select Web Form using Master page > Enter Page name >Add.- Home.aspx
- About.aspx
- MainPage.aspx
- SubPage1.aspx
- SubPage2.aspx
Step-3: Add a Sitemap file.
Go to Solution Explorer > Right Click on Project > Add > New item > Select "Site Map" File > Enter Page name >Add.Write below text (Content as your Site Structure) to SiteMap file.
Step-4: Modify web.config
Add this inside System.web file.Step-5: Add SiteMapDataSource control into site.master page.
Step-6: Add Menu control in Master page.
<asp:Menu ID="Menu1" runat="server" CssClass="menu"
EnableViewState="false" IncludeStyleBlock="false" StaticDisplayLevels="2"
Orientation="Horizontal" DataSourceID="SiteMapDataSource1" >
</asp:Menu>
Step-7: Add SitemapPath control into Master page.
Step-8: Run Application
Click on Menu Link and Check your SiteMap path.Related Post: