mvcsitemapprovider

How to add custom xml tags to sitemap.xml using mvcsitemapprovider?

核能气质少年 提交于 2019-12-03 14:40:21
Based on what Google defines in Video sitemaps , There are some xml tags should be added to sitemaps for videos, and it should be like this: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> <url> <loc>http://www.example.com/videos/some_video_landing_page.html</loc> <video:video> <video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc> <video:title>Grilling steaks for summer</video:title> <video:description>Alkis shows you how to get perfectly done steaks every time</video:description> <video

Creating child nodes for a DynamicNode in MvcSiteMapProvider that have dynamic parameters

会有一股神秘感。 提交于 2019-12-03 02:02:11
问题 I am using MvcSiteMapProvider 2.2.1 (http://mvcsitemap.codeplex.com), and am having a problem with creating children under a dynamic node (using a dynamicNodeProvider) when those children have a dynamic parameter (id). I am losing breadcrumbs for the following route: Stores/5/Products/Edit/23 where the url pattern is: Stores/{storeID}/{controller}/{action}/{id} It works fine when the ID is left out (ie the "New" action). But when the ID is specified, it doesn't match the route, and my

Make MVC Sitemap unique per session, not user

淺唱寂寞╮ 提交于 2019-12-02 17:45:50
问题 Our MvcSitemap has some DynamicNodeProviders implemented. We want these to be unique per session. But it appears they are unique per user. So if a user logs into two different browsers, or computers, they currently share the same sitemap. We do not want this. But I can't seem to figure out how to get it to use the User/Session combination for uniqueness. Is there a way to make this work? 回答1: Option 1: Implement your own ICacheProvider based on session state and inject it using DI. using

c# MVC Site Map - very slow when using roles - very slow

此生再无相见时 提交于 2019-12-02 16:26:52
问题 I've installed MVC Site Map Provider for MVC5 and just used everything out of the the box. It works fine. Now I want to implement roles based menu trimming so assuming my controller: public class Home: Controller { [Authorize(Roles="Admin")] public ActionResult Index() { return View(); } } Now basically only Admin role users can see the menu. Perfect works fine. Also to implement this I added to my web.config this line: <add key="MvcSiteMapProvider_SecurityTrimmingEnabled" value="true" /> The

Creating child nodes for a DynamicNode in MvcSiteMapProvider that have dynamic parameters

落爺英雄遲暮 提交于 2019-12-02 15:39:00
I am using MvcSiteMapProvider 2.2.1 (http://mvcsitemap.codeplex.com), and am having a problem with creating children under a dynamic node (using a dynamicNodeProvider) when those children have a dynamic parameter (id). I am losing breadcrumbs for the following route: Stores/5/Products/Edit/23 where the url pattern is: Stores/{storeID}/{controller}/{action}/{id} It works fine when the ID is left out (ie the "New" action). But when the ID is specified, it doesn't match the route, and my breadcrumbs (using the SiteMapPath helper) is blank. My Sitemap: (abreviated) <?xml version="1.0" encoding=

c# MVC Site Map - very slow when using roles - very slow

痴心易碎 提交于 2019-12-02 12:20:28
I've installed MVC Site Map Provider for MVC5 and just used everything out of the the box. It works fine. Now I want to implement roles based menu trimming so assuming my controller: public class Home: Controller { [Authorize(Roles="Admin")] public ActionResult Index() { return View(); } } Now basically only Admin role users can see the menu. Perfect works fine. Also to implement this I added to my web.config this line: <add key="MvcSiteMapProvider_SecurityTrimmingEnabled" value="true" /> The problem is that it works but it's slow. It takes about 7 seconds for the page to load. If I remove the

MVC Site Map Provider and localization

女生的网名这么多〃 提交于 2019-12-02 10:32:13
I've found out today that for my site i could use a SiteMap provider which i've downloaded from Github for the MVC3, as my web application is MVC3. Situation is following, my application is multilingual. I have a separate Library which contains all the resources. This Library is then added to my current project and everywhere where i need i use those resource files. Now i've implemented the site map provider: <mvcSiteMapNode title="$resources:Base,Home" controller="Home" action="Index" enableLocalization="true"> <mvcSiteMapNode title="Search" controller="Search" action="Index"/>

Make MVC Sitemap unique per session, not user

这一生的挚爱 提交于 2019-12-02 09:35:32
Our MvcSitemap has some DynamicNodeProviders implemented. We want these to be unique per session. But it appears they are unique per user. So if a user logs into two different browsers, or computers, they currently share the same sitemap. We do not want this. But I can't seem to figure out how to get it to use the User/Session combination for uniqueness. Is there a way to make this work? NightOwl888 Option 1: Implement your own ICacheProvider based on session state and inject it using DI. using System; using System.Collections.Generic; using MvcSiteMapProvider.Web.Mvc; using MvcSiteMapProvider

MVC5 using MvcSiteMapProvider to build twitter bootstrap menu

僤鯓⒐⒋嵵緔 提交于 2019-12-01 09:38:32
Default menu section in MVC5 template looking like that: <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> @Html.Partial("_LoginPartial") </div> _LoginPartial looking like that: @using Microsoft.AspNet.Identity @if (Request.IsAuthenticated) { using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) { @Html.AntiForgeryToken() <ul class="nav navbar-nav navbar

MVC5 using MvcSiteMapProvider to build twitter bootstrap menu

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 09:09:19
问题 Default menu section in MVC5 template looking like that: <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> @Html.Partial("_LoginPartial") </div> _LoginPartial looking like that: @using Microsoft.AspNet.Identity @if (Request.IsAuthenticated) { using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id =