MVC site provider and css style

Does anyone know how to set up the rendering of a Sitemap provider for MVC, so my ul element has a specific css class?

+3
source share
1 answer

Try the MvcSiteMapProvider hosted on CodePlex. You should be able to quite easily migrate your existing Sitemap to a slightly different, but essentially compatible format. This will give you the ability to display a site map using a simple helper method Html.MvcSiteMap().SiteMap().

The source of the project is the default templates, which you can edit to create any rendering you like ... or simply pass the template name in accordance with the MVC convention. The types of patterns that you will show - is SiteMapHelperModel, SiteMapNodeModeland SiteMapNodeModelList(namespace removed for patience).

I appreciate that this may not be exactly what you need, as it relies on a third-party tool, but its a useful project that supports much more than just rendering sitemaps. You will need version 3.0.0 for MVC3.

Dan

+3
source

All Articles