[Mono-dev] ASP.NET Web.sitemap

Dariusz Linowski darlin1 at linbit.pl
Sat Jan 6 20:12:27 EST 2007


Hello,

I have tried to use site navigation based on Web.sitemap file in mono
ASP.NET 2.0. If I directly moved working application from windows to
mono I received error:

System.InvalidOperationException: This feature is currently disabled.
Please enable it in the system.web/siteMap section in the web.config
file.
  at System.Web.SiteMap.Init () [0x00000]

So, I modified Web.Config file and added:


<siteMap enabled="true">
      <providers>

        <add name="MenuProvider"
          type="System.Web.XmlSiteMapProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          siteMapFile="Web.sitemap"/>

  </providers>
    </siteMap>

After this modification I received error :

System.ArgumentNullException: Argument cannot be null.
Parameter name: key
  at System.Web.SiteMapNode..ctor (System.Web.SiteMapProvider
provider, System.String key, System.String url, System.String title,
System.String description, IList roles,
System.Collections.Specialized.NameValueCollection attributes,
System.Collections.Specialized.NameValueCollection
explicitResourceKeys, System.String implicitResourceKey) [0x00000]
  at System.Web.XmlSiteMapProvider.BuildSiteMapRecursive
(System.Xml.XmlNode xmlNode) [0x00000]


What is wrong or missing?



file: MasterPage.master
<asp:TreeView ID="TreeView1" runat="server"
DataSourceID="SiteMapDataSource1" ShowLines="True">
        </asp:TreeView>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
SiteMapProvider="MenuProvider" ShowStartingNode="False" />


-- 
---------------------------------------------------------------------------------------------------------------
Pozdrawiam,
                  Dariusz Linowski



More information about the Mono-devel-list mailing list