asp.net mvc 4 - MVC Site Map Provider ConfigurationErrorException: The site map file is invalid -


i reduced sitemap see problem , way can't.

<?xml version="1.0" encoding="utf-8" ?> <mvcsitemap xmlns="http://mvcsitemap.codeplex.com/schemas/mvcsitemap-file-3.0"         enablelocalization="true">   <mvcsitemapnode key="0" title="bpm" controller="oee" action="stationcycletime">     <mvcsitemapnode key="1" title="liveoee" controller="oee" action="liveoee">     </mvcsitemapnode>   </mvcsitemapnode> </mvcsitemap> 

in view:

@html.devexpress().menu( settings => {     settings.name = "mvc";     settings.allowselectitem = true;     settings.encodehtml = false;     settings.orientation = system.web.ui.webcontrols.orientation.horizontal;     settings.width = 100; }).bindtositemap("~/mvc.sitemap", false).gethtml() 

i tried without key attribute, putting url instead of controller , action, nothing works.

some ideas please

the way see it, devexpress doesn't support mvc sitemap provider implementation. can use plain old sitemap instead. if you're comfortable that, bind devexpress menu sitemap file:

<?xml version="1.0" encoding="utf-8" ?> <sitemap xmlns="http://schemas.microsoft.com/aspnet/sitemap-file-1.0" >   <sitemapnode title="bpm" url="oee/stationcycletime">     <sitemapnode title="liveoee" url="oee/liveoee" />   </sitemapnode> </mvcsitemap> 

it leaves without extended functionality mvc implementation offers :(

however, can make use of menu (menusettings) event itemdatabound property , attach own (e.g. anonymous) handler capture default binding. , add own custom attribute handling:

@html.devexpress().menu( settings => {     settings.name = "mvc";     settings.allowselectitem = true;     settings.encodehtml = false;     settings.orientation = system.web.ui.webcontrols.orientation.horizontal;     settings.width = 100;     settings.itemdatabound = (sender, e) =>     {         var node = e.item.dataitem sitemapnode;          if (node != null)         {             if (!string.isnullorempty(node["key"]))             {                 // lookup key             }         }      }; }).bindtositemap("~/mvc.sitemap", false).gethtml() 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -