配置节'siteMap'不能被读取,因为它缺少一个段声明

问题描述:

我有这个代码在我的web.config但我仍然有一个错误。我使用的是IIS 7.5和Windows 7专业版配置节'siteMap'不能被读取,因为它缺少一个段声明

> <siteMap> 
>  <providers> 
>  <clear/> 
>  <add name="SiteMapDataSource1" description="Default SiteMap provider." type="System.Web.XmlSiteMapProvider" 
> siteMapFile="web.sitemap" /> 
>  </providers> </siteMap> 

错误

配置节“地图”不能读,因为它是 缺少一个部分声明

我有这个代码在masterPage.master

    <asp:TreeView ID="TreeView1" runat="server" CssClass="style6" DataSourceID="SiteMapDataSource1" 
         Width="220px" AutoGenerateDataBindings="False" Height="263px" ImageSet="Arrows"> 
         <ParentNodeStyle Font-Bold="False" /> 
         <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /> 
         <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" 
          VerticalPadding="0px" /> 
         <NodeStyle Font-Size="12pt" ForeColor="Black" HorizontalPadding="5px" NodeSpacing="0px" 
          VerticalPadding="0px" Font-Names="Times New Roman" /> 
        </asp:TreeView> 
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="true" 
         EnableViewState="false" /> 

你必须把你的<siteMap>...</siteMap>里面<system.web>...</system.web>得到它的工作。

更多信息:http://msdn.microsoft.com/en-us/library/ms178428.aspx