问题标签 [asp.net-mvc-sitemap]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net - MvcSiteMapProvider 可见性不起作用
我有一个 asp.net mvc 4 web 应用程序。我使用 MvcSiteMapProvider 来制作我的菜单。我在 mvcSiteMapNode 设置了可见性属性。喜欢 :
使用 ISiteMapNodeVisibilityProvider 的高级节点可见性
但我发现它不起作用。
然后我将 FilteredSiteMapNodeVisibilityProvider 添加到我的项目中进行测试。我将断点设置为“node.Attributes.ContainsKey("visibility")”,发现 ISiteMapNode 无法获取属性“visibility”。但我试图设置一个自定义属性(例如可见),它可以得到。
我该怎么做可见性属性?
asp.net-mvc-sitemap - mvcsitemapprovider 根据 url 参数在面包屑中显示隐藏节点
我在面包屑中使用 mvcsitemapprovider。在网站的某些部分,我只想在参数满足某些条件时才显示子节点。所有节点都已在 Mvc.sitemap 中定义。我只想隐藏它们,直到 URL 参数满足要求。
我想知道 DynamicNodeProvider 是否是我唯一的选择。我不能在运行时显示/隐藏几个节点吗?
请帮忙。
asp.net-mvc - 如何让 MvcSiteMapProvider 每个区域创建 1 个站点地图?
如何为每个 MVC 区域制作 1 个 SiteMap 并同时使用 MvcSiteMapNodeAttribute?
c# - 如何构建具有多个子站点地图的站点地图?
我正在使用 MVC4,MvcSiteMapProvider v3.2.1(需要能够升级到 v4)。
我的问题是应用程序很大。我想模块化应用程序并使模块可插拔。
由于站点地图已经很大,我想让站点地图也可以插入。
有没有办法在应用程序启动时使用来自多个 xml 文件的根站点地图加载节点来构建站点地图?
这是解释的示例:
原始站点地图:
我想将站点地图拆分为:
根站点地图:
员工网站地图:
客户端站点地图:
mvcsitemapprovider - Defalut XmlSiteMapProvider 实现不能使用 SiteMap.FindSiteMapNode?
我只是将 MvcSiteMapProvider 从 v3 升级到 v4.6.3。
我看到升级说明表明:
一般来说,任何对的引用System.Web.SiteMap.Provider
都需要更新为MvcSiteMapProvider.SiteMaps.Current
我正在尝试使用以下方法获取站点地图节点:
SiteMaps.Current.FindSiteMapNode(rawUrl)
但它总是返回 null
我查看了代码。在站点地图中,它实际上是在调用该函数:
它试图在urlTable中找到匹配项。
我正在使用XmlSiteMapProvider
.
它定义var url = node.GetAttributeValue("url");
因此,如果我没有在 .sitemap 文件中定义url
或属性。urlResolver
这些变量在生成节点时设置为空字符串。
当这个节点被传递给AddNode
函数时SiteMap
。
添加节点时
此代码将检查是否存在url
或urlResolver
最后没有 url 添加到urlTable
,导致FindSiteMapNode
找不到任何东西。
我不确定是否需要特定的配置。或者我应该实施自定义XmlSiteMapProvider
只是添加网址。
mvcsitemapprovider - 如何使用带有动态参数的 Html.MvcSiteMap().Menu()?
我正在使用 MvcSiteMapProvider 4.6.3、MVC 4。
我想使用 Html.MvcSiteMap().Menu() 来生成菜单。
问题是我在 URL 中有多个参数,这些参数会根据用户和文档 ID 进行更改。
我的站点地图如下所示:
这些动作需要不同的参数。
我尝试使用 Html 助手来生成菜单。
因此,如果我在索引页面上。菜单应该是
站点地图Test/Index/product1?clientId=clientId2
站点地图Test/Index/client1?productId=product2
SitemapTest/Index/client1?staffId=staffId1
这些 id 是从数据库中获取的。
有没有办法将参数传递给 Html 帮助以指定每个链接使用哪个 Id?
mvcsitemapprovider - How to make the cache to refresh when the XML is changed?
I am using MvcSiteMapProvider 4.6.3, MVC 4. Using DI to config the Sitemap.
How to make it automatically update the cache when the Sitemap xml is updated?
I am upgrading MvcSitemapProvider from v3 to v4. In version 3, it seems the sitemap is automatically refreshed.
I did set the cache expiration time to be 5 min, is this causing problem?
UPDATE
When I change the sitemap xml file the cache is not updated till 5 min the cache expire. I am using multiple sitemap xml files.
Will this be the reason it's not working?
mvcsitemapprovider - 单击 MvcSiteMap 父节点切换下拉但不导航到 URL
我有一个 MvcSiteMap,其父 MvcSiteMapNode 包含子节点。父节点有一个 url,子节点有 url。显示时,当鼠标悬停在父节点上时,子节点出现在其下方,但是当单击父节点时,子节点消失但网页没有导航到父节点的url。
是什么导致页面无法导航?
编辑(图片示例):
我的假设是单击事件被劫持以使子节点下拉列表消失而不被传递
单击之前将鼠标悬停在父节点上:
点击后,下拉菜单消失,没有导航到“~/ParentUrl”
asp.net-mvc-5 - 在 ASP.NET MVC 5 中使用 mvcSitemap
如何在 ASP.NET MVC 应用程序中集成 mvc 站点地图以提供基于角色的访问控制,这是最好的原因还是有更好的方法来进行基于角色的访问?
asp.net-mvc - SiteMapPath - 通过路由和查询字符串传递参数
我在 ASP.NET MVC 5 项目中使用 MVCSiteMapProvider 4.6.7。我在mvc.sitemap
文件中有这个:
我正在显示这样的站点地图路径:
当我导航到 时http://siteurl/User/Edit/2
,会显示站点地图路径,但当我导航到 时http://siteurl/User/Edit?id=2
,则不会。
删除preservedRouteParameters="id"
将扭转这种情况(站点地图显示为.../Edit?id=2
,但不是.../Edit/2
)
有没有办法让它们都工作?