Hi
IMBack:
The sitemapdatasource control can access the sitemap defaultly.
1.Does this mean, it links as long as I put anything in DataSourceID and asp:SiteMapDataSource Id, and it just finds the sitemap file and links it to the master file (defaulty) Is it correct?
My answer is yes, but your sitemap file must be in the root directory, and the sitemap file's name must be web.sitemap.
IMBack:
The sitemap file name specified is web.sitemap ,
and the location is also fixed, viz.must be at the application's root directory.
2. I dont have the location fixed in master file with sitemap.
In fact, it is not importent where the master page file located, the Web.sitemap file must be located in the application root directory. If the sitemap file is not in the root directory, you should do some config in the we.config file. (You can refer the code I post it at the below)
IMBack:
3.what if I have more than one sitemap ( 2 menus), how does it know which one to map to? "where is the relationship"
If you have more than one sitemap files in the application.
Firstly, To configure multiple site maps in the Web.config file
For example:
<siteMap>
<providers>
<add name="Web" type="System.Web.XmlSiteMapProvider" siteMapFile="web.sitemap"/>/// the sitemap file is in the root directory
<add name="Web2" type="System.Web.XmlSiteMapProvider" siteMapFile="web2.sitemap"/>/// the sitemap file is in the root directory
<add name="Web3" type="System.Web.XmlSiteMapProvider" siteMapFile="web3.sitemap"/>/// the sitemap file is in the root directory
<add name="Web4" type="System.Web.XmlSiteMapProvider" siteMapFile="~/SiteMaps/web.sitemap"/> // the sitemap file is not in the root directory
</providers>
</siteMap>
Then set the sitemap provider for sitedatasource control.
For Example:
this.SiteMapDataSource4.Provider = SiteMap.Providers["Web4"];
this.SiteMapDataSource1.Provider = SiteMap.Providers["Web"];
this.SiteMapDataSource2.Provider = SiteMap.Providers["Web2"];
this.SiteMapDataSource3.Provider = SiteMap.Providers["Web3"];
So the sitemapdatasource will link to the different sitemap files.
You can read more in this MSDN article: How to: Configure Multiple Site Maps and Site-Map Providers
Hope it helps.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Yours sincerely,
Amanda Wang
Microsoft Online Community Support