1、添加一個網站地圖項 Web.sitemap項
2、在 Web.sitemap項的寫法如下:
<?xml version="1.0" encoding="utf-8"?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode url="default.aspx" title="首頁" description="">
<siteMapNode url="Supply.aspx" title="產品資訊" description="" >
<siteMapNode url="productdetails.aspx" title="產品詳細資料" description="" />
</siteMapNode>
<siteMapNode url="register.aspx" title="新使用者註冊"/>
<siteMapNode url="Demand.aspx" title="產品資訊" description="">
</siteMapNode>
<siteMapNode url="Projects.aspx" title="招投標資訊" description="">
<siteMapNode url="DownLoad.aspx" title="相關表格下載" description="" />
<siteMapNode url="ProjectInfor.aspx" title="招投標詳細資料" description="" />
</siteMapNode>
<siteMapNode url="newsfront.aspx" title="新聞" description="">
<siteMapNode url="news_detail.aspx" title="行業資訊詳細資料" description="" />
<siteMapNode url="company_details.aspx" title="會員展廳詳細資料" description="" />
<siteMapNode url="ManuscriptFront.aspx" title="線上投稿" description="" />
<siteMapNode url="subject_detail.aspx" title="專題欄目詳細資料" description="" />
<siteMapNode url="expertinterview_detail.aspx" title="人物專訪詳細資料" description="" />
</siteMapNode>
<siteMapNode url="ForeTrain.aspx" title="培訓諮詢" description="">
<siteMapNode url="TrainInfor.aspx" title="培訓詳細資料" description="" />
<siteMapNode url="BusiHandBook.aspx" title="商務手冊" description="" />
<siteMapNode url="Technology.aspx" title="技術諮詢" description="">
<siteMapNode url="TechInfor.aspx" title="技術資訊" description=""/>
</siteMapNode>
<siteMapNode url="Expert.aspx" title="專家顧問團" description="" />
</siteMapNode>
<siteMapNode url="ExhibitFront.aspx" title="機電資訊展覽館" description="">
<siteMapNode url="exhibit_detail.aspx" title="會展詳細資料" description=""/>
</siteMapNode>
</siteMapNode>
</siteMap>
3、在web.config檔案中的配置如下:
<system.web>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<add name="XmlSiteMapProvider"
description="SiteMap provider which reads in .sitemap XML files."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="web.sitemap"/>
</providers>
</siteMap>
</system.web>
4、在頁面需要網站地圖的位置放入SiteMapPath控制項,設定SiteMapPath的SiteMapProvider屬性為config檔案中的name的值:XmlSiteMapProvider
即完成網站地圖的製作。