mvcsitemapprovider

Create breadcrumbs Path in asp.net MVC

天大地大妈咪最大 提交于 2019-12-12 11:17:21
问题 I'm trying to create a breadcrumbs that includes pages viewed by user, like the example: Home -> Products -> Smartphones -> ..... Does anyone know how to do that in asp.net mvc 3 with razor view engine ? Or where i can find a good tutorial ? 回答1: There is an open source project called MvcSiteMapProvider that I have been contributing to that makes this fairly easy. The project is available on NuGet. Basically, you configure an sitemap with all of your pages. The sitemap can be configured in

With MvcSiteMapProvider Is it possible to programmatically register lots of pages between index ranges?

南楼画角 提交于 2019-12-12 02:26:35
问题 I'm looking at MVCSiteMapProvider but I can't find anything in documentation that would allow me to register lots of urls by index. I have the following http://example.com/story/1 ... ... http://example.com/story/7000000 I'd like to be able to use the library to automatically serve these in lots of different files. I've read through all the documentation but can't find anything. It seems really fully featured though so I thought I would ask before rolling my own solution. 回答1: You can use a

Using asp.net MVCSiteMapProvider v4 with 2 sitemap

社会主义新天地 提交于 2019-12-11 20:15:24
问题 Hi I would like to use asp.net MVCSiteMapProvider v4 with 2 different sitemaps, one for the main site and one for the admin area. I have done some search and I have found that you need insert it on web.config: <siteMap defaultProvider="AppSiteMapProvider" enabled="true"> <providers> <clear /> <add name="AppSiteMapProvider" type="MvcSiteMapProvider.DefaultSiteMapProvider, MvcSiteMapProvider" siteMapFile="~/Mvc2.sitemap" securityTrimmingEnabled="true" cacheDuration="5" enableLocalization="true"

How to Config MVCSiteMap to realize the parameters?

只谈情不闲聊 提交于 2019-12-11 18:06:23
问题 I'm new to MVCSiteMap and I have a simple question: I use the default route config like this: routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }); Now in my controller, I want to create and edit an entity in the same Action: public ActionResult AddEdit(int? id) {} so if the id is null, it means add, and if it is not null then the action is edit. Now I want the site map to realize the

How to configure multiple sitemaps using using MVCSiteMapProvider v4 with Unity DI

允我心安 提交于 2019-12-11 15:59:26
问题 I am working on an ASP.NET MVC 4 application that contains multiple areas. As per project requirements each area should have its own sitemap file. From this article: https://github.com/maartenba/MvcSiteMapProvider/wiki/Multiple-Sitemaps-in-One-Application, I understand that in order to make MvcSiteMapProvider work with multiple sitemaps it is necessary to use an external DI. Therefore, I installed the package: MvcSiteMapProvider.MVC4.DI.Unity.Modules and modified the class

The view must derive from WebViewPage, or WebViewPage<TModel>, @Html.MvcSiteMap().SiteMapPath() error

非 Y 不嫁゛ 提交于 2019-12-11 14:48:35
问题 I have a problem with running MVC application (which is set as class library). On IIS server I have created new ApplicationPool for my webSite (on framework v. 4.0). I have installed patch for framework 4.0 from microsoft website: Update 4.0.2 for Microsoft .NET Framework 4 – Design-time Update for Visual Studio 2010 SP1 (KB2544525) (http://www.microsoft.com/en-us/download/details.aspx?id=27759) My Layout.cshtml website looks like: <div id="content"> <div id="breadcrumb"> <div id="breadcrumb

MvcSiteMapProvider hidden mvcSiteMapNode with CRUD operation

六眼飞鱼酱① 提交于 2019-12-11 13:37:30
问题 In a project, i've implemented MvcSiteMapProvider that work great. This is a side menu generated with @Html.MvcSiteMap().Menu() Here is a node of the menu (Mvc.sitemap file). <mvcSiteMapNode title="Home" controller="Home" action="Index"> <mvcSiteMapNode title="About" controller="Home" action="About"/> <mvcSiteMapNode title="Project" controller="Home" action="DummyAction"> <mvcSiteMapNode title="List" controller="Home" action="Project"/> <mvcSiteMapNode title="Edit" controller="Home" action=

change parent Key dynamically - IDynamicNodeProvider MVC

社会主义新天地 提交于 2019-12-11 13:11:24
问题 I implement IDynamicNodeProvider according to this https://github.com/maartenba/MvcSiteMapProvider/wiki/Defining-sitemap-nodes-using-IDynamicNodeProvider I would like to change the parent Key dynamically. I have a lot of parent nodes according to my menu navigation. Some example is 1) Home>Profile>Quality Policy 2) Home>eServices>eService I have two tables. In the first one I keep my menus. MenuID, MenuTitle and in the other I store my content. ArticleID, ArticleTitle, ArticleContent, MenuID.

MvcSiteMapProvider No Separetor

扶醉桌前 提交于 2019-12-11 12:04:31
问题 I don't want the MvcSiteMapProvider to display the " > " separtor betweent the breadcrumbs. Example: Home > Contact What I want: Home Contact (a separetor between the breadcrumbs is added with CSS). I dodn't found any property called "separetor" to set this in the docu (https://github.com/maartenba/MvcSiteMapProvider/wiki). 回答1: MvcSiteMapProvider uses templated HTML helpers. You can edit the templates any way you want to change the output HTML to meet your needs (including the separator

MVC Site Map Provider - SiteMapPath Performance Very Slow?

吃可爱长大的小学妹 提交于 2019-12-11 11:21:35
问题 I have an MVC site and we are using MVCSiteMapProvider 4.4.3 with Autofac. We construct our site using a mixture of XML and Attributes. We have a few hundred dynamic nodes and we have security trimming enabled. Site has been getting larger over the last year with approximately 120 controllers. All controllers are secured using authorize attributes that vary per role etc. In our layout we call @Html.MvcSiteMap().SiteMapPath() this adds approximately 950ms onto page load time. If we remove the