Creating a sinle sitemap is easy. Just follow these steps:-
1) Write click on Project->Add New Item - >Select Sitemap
2) Default name is Web.sitemap (you can change the name if you want)
3) Click Ok
A web.sitemap is added to your solution
Now you can simply add SiteMapNodes.
1) All sitemapnodes should be under one sitemap Eg, "Home"
2) You can do nesting by adding one sitemap under another as per the flow of your website
Example,
<siteMapNode url ="~/Home.aspx" title="Home" description="">
<siteMapNode url="~/Company.aspx" title="Companies" description="" >
</siteMapNode>
</siteMapNode>
<siteMapNode url="~/Products.aspx" title="Services" description="" >
<siteMapNode url="~/ProductsDetails.aspx" title="Product Details"/>
</siteMapNode>
<siteMapNode title="Categories" url="~/Category.aspx">
<siteMapNode url="~/Electronics.aspx" title="Electronics">
<siteMapNode url="~/Food.aspx" title="Food"/>
<siteMapNode url="~/AutoMobiles.aspx" title="AutoMobiles"/>
<siteMapNode url="~/Clothes.aspx" title="Clothes"/>
</siteMapNode>
</siteMapNode>
Now your sitemap is created. To display it, add a new aspx page to your project. Add an asp control SiteMapDataSource and give it an ID. Drag a tree view control on it and set its DataSourceID to ID of the SitemapDataSource. Example,
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />
<asp:treeview ID="Treeview1" runat="server" DataSourceID="SiteMapDataSource1" >
But what if you want to add multiple sitemaps into your project???
Well the steps are simple again. Just keep on adding sitemaps to your project in the same way. But you need to make few changes in web.config.
In <system.web> add a tag <siteMap> and add Providers in it as shown:-
<siteMap>
<providers>
<add name="Components" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Components.sitemap" />
<add name="AboutUs" type="System.Web.XmlSiteMapProvider" siteMapFile="~/AboutUs.sitemap" />
<add name="AboutYou" type="System.Web.XmlSiteMapProvider" siteMapFile="~/AboutYou.sitemap" />
</providers>
</siteMap>
In this I have created three SiteMaps -
Components.sitemap, AboutUs.sitemap, AboutYou.sitemap
And have specified their type as XmlSiteMapProvider and given them different IDs.
Now on your aspx page when you add asp control SitemapDataSource , add a new attribute to it "SiteMapProvider" and set its value to the ID field mentioned in Web.Config, as follows:-
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" SiteMapProvider="AboutUs" />
Everything else remains same.
I hope it helped you.
Cheers
Esha
1) Write click on Project->Add New Item - >Select Sitemap
2) Default name is Web.sitemap (you can change the name if you want)
3) Click Ok
A web.sitemap is added to your solution
Now you can simply add SiteMapNodes.
1) All sitemapnodes should be under one sitemap Eg, "Home"
2) You can do nesting by adding one sitemap under another as per the flow of your website
Example,
<siteMapNode url ="~/Home.aspx" title="Home" description="">
<siteMapNode url="~/Company.aspx" title="Companies" description="" >
</siteMapNode>
</siteMapNode>
<siteMapNode url="~/Products.aspx" title="Services" description="" >
<siteMapNode url="~/ProductsDetails.aspx" title="Product Details"/>
</siteMapNode>
<siteMapNode title="Categories" url="~/Category.aspx">
<siteMapNode url="~/Electronics.aspx" title="Electronics">
<siteMapNode url="~/Food.aspx" title="Food"/>
<siteMapNode url="~/AutoMobiles.aspx" title="AutoMobiles"/>
<siteMapNode url="~/Clothes.aspx" title="Clothes"/>
</siteMapNode>
</siteMapNode>
Now your sitemap is created. To display it, add a new aspx page to your project. Add an asp control SiteMapDataSource and give it an ID. Drag a tree view control on it and set its DataSourceID to ID of the SitemapDataSource. Example,
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />
<asp:treeview ID="Treeview1" runat="server" DataSourceID="SiteMapDataSource1" >
But what if you want to add multiple sitemaps into your project???
Well the steps are simple again. Just keep on adding sitemaps to your project in the same way. But you need to make few changes in web.config.
In <system.web> add a tag <siteMap> and add Providers in it as shown:-
<siteMap>
<providers>
<add name="Components" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Components.sitemap" />
<add name="AboutUs" type="System.Web.XmlSiteMapProvider" siteMapFile="~/AboutUs.sitemap" />
<add name="AboutYou" type="System.Web.XmlSiteMapProvider" siteMapFile="~/AboutYou.sitemap" />
</providers>
</siteMap>
In this I have created three SiteMaps -
Components.sitemap, AboutUs.sitemap, AboutYou.sitemap
And have specified their type as XmlSiteMapProvider and given them different IDs.
Now on your aspx page when you add asp control SitemapDataSource , add a new attribute to it "SiteMapProvider" and set its value to the ID field mentioned in Web.Config, as follows:-
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" SiteMapProvider="AboutUs" />
Everything else remains same.
I hope it helped you.
Cheers
Esha
when using multiple sitemaps, for using breadcrumb no changes need to be done...
ReplyDeleteGood Post
ReplyDeleteKeep on working, great job!
ReplyDeleteMy page Time and attendance Johannesburg
Great article with excellent idea! I appreciate your post. Thanks so much and let keep on sharing your stuffs keep it up. Private University in Punjab
ReplyDeleteIt's very nice post , Thanks For sharing
ReplyDelete.Net Online Training Hyderabad
Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
ReplyDeleteCEH Training In Hyderbad
And indeed, Iam just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I have had.
ReplyDeleteDotnet Training in Chennai
Matlab Training in Chennai
Embedded Training in Chennai
SAS Training in Chennai
Powerbi Training in Chennai
R Programming Training in Chennai
Javascript Training in Chennai
Oracle DBA Training in Chennai
Great post. Keep sharing.. Home lift India
ReplyDeletenice very informative....
ReplyDeleteInterview Question for CTS Placement
Cognizant Interview Questions For Fresher
Cognizant Interview Questions
Resume Coustomer Service Executive
Resume For Bank Job
Resume Cyber security Engineer
Resume Data Base Developer
Resume DeputyManager
Resume Design Engineer
Resume Desktop Support Engineer
ReplyDeleteI just wanted to let you know that the piece you shared with us is pretty unique and authentic. I am going to keep browsing this blog.
Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
Thanks for sharing such informative guide on .Net technology. This post gives me detailed information about the .net technology. I am working as trainer in leading IT training academy offering Dot Net Training in Chennai
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
perde modelleri
ReplyDeleteSMS ONAY
MOBİL ÖDEME BOZDURMA
Nft nasıl alinir
ankara evden eve nakliyat
Trafik sigortasi
DEDEKTOR
web sitesi kurma
Ask kitaplari
smm panel
ReplyDeleteSMM PANEL
iş ilanları
İnstagram Takipçi Satın Al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
Tiktok jeton hilesi indir
en son çıkan perde modelleri
ReplyDeleteen son çıkan perde modelleri
lisans satın al
minecraft premium
özel ambulans
nft nasıl alınır
yurtdışı kargo
uc satın al
Success Write content success. Thanks.
ReplyDeletebetpark
canlı slot siteleri
betmatik
betturkey
kıbrıs bahis siteleri
kralbet
canlı poker siteleri
dijital kartvizit
ReplyDeletereferans kimliği nedir
binance referans kodu
referans kimliği nedir
bitcoin nasıl alınır
resimli magnet
AFGAV
hatay
ReplyDeletekars
mardin
samsun
urfa
7NZXGW
artvin
ReplyDeletebitlis
niğde
hatay
tunceli
YWİZK0
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
OS77Vİ
ds
ReplyDeletetyujytujikuikjukjhnjhj
ReplyDeleteشركة صيانة افران بالاحساء
شركة صيانة افران بالاحساء L6eUowQTOW
ReplyDeleteشركة مكافحة حشرات بالجبيل YEASyv4ucD
ReplyDeleteشركة تنظيف مجالس بخميس مشيط 78bFAdYgqz
ReplyDeleteشركة مكافحة بق الفراش بالاحساء 0CJ7hL6FPv
ReplyDeleteشركة تسليك مجاري بالقطيف 9Iy2UVySBh
ReplyDeleteشركة مكافحة النمل الابيض بالقطيف k3RacVNgeL
ReplyDeleteشركة مكافحة حشرات بالاحساء 8Y6h0ORlPD
ReplyDelete