Tuesday, September 4, 2012

ASP.NET using SiteMapPath control on multiple sitemap on asp.net

Some project we have a lot of page for many types of user,Multiple sitemap can provide multiple url link for this case.
We have 3 step for this solution.

zomdev.blogspot.com ASP.NET using SiteMapPath control on multiple sitemap on asp.net

Step 1 : Add new Web.SiteMap

        <?xml version="1.0" encoding="utf-8" ?>
        <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
            <siteMapNode url="" title="Web.Sitemap"  description="">
                <siteMapNode url="~/BLOG/ASP_NET/Sitemap/SitemapPath/Default.aspx" title="SiteMap1"  description="Admin" />
            </siteMapNode>
        </siteMap>
    

Step 2 : In Web.Config > system.web siteMap > providers > add

        <add name="w1" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.Sitemap"/>
        <add name="w2" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web2.sitemap"/>
    

Step 2 :

        <asp:SiteMapPath runat="server" ID="SiteMapPath1" SiteMapProvider="w1">
        </asp:SiteMapPath>
        <hr />
        <asp:SiteMapPath runat="server" ID="SiteMapPath2" SiteMapProvider="w2">
        </asp:SiteMapPath>
    

Pls enjoy ZomDev

No comments:

Post a Comment

Post a Comment