I use the web.sitemap of my ASP.net application to help build my navigation links. This way if my navigation changes, I update the web.sitemap, and it builds my navigation automatically. However since upgrading from ASP.net 3.5 to 4.0 I'm having problems related to my web.sitemap file. After upgrading to ASP.net 4.0 the links generated from my web.sitemap sometimes have strange characters inserted after the domain name (link broken on purpose because my limit is 2):
http //www.cheatsheetwarroom.com/(A(jUhJqoX4zAEkAAAAN2VlZTM2N2MtOWU5Mi00OWUyLTllZTUtMTY4MDY3ZGM2MTM2hMR-oHFFNS-DvXxMDadonaHu8pk1))/fantasy-football/nfl/free/rankings/offense/running-backs.aspx
You can see …
我在asp.net mvc中使用内置的asp.net站点地图,具有以下架构
我有以下属性,resourcekey,title和description.我想在sitemapNode中添加更多属性,请告诉我是否可以在站点地图文件中添加新属性,然后通过站点地图类阅读.
我有一个像这样的web.sitemap:
<siteMapNode url="~/Default.aspx" title="Home" description="" >
<siteMapNode title="Node 1" description="">
<siteMapNode url="" title="Node 1-1" description="" />
<siteMapNode url="" title="Node 1-2" description="" />
</siteMapNode>
<siteMapNode title="Node 2" description="">
<siteMapNode url="" title="Node 2-1" description="" />
<siteMapNode url="" title="Node 2-2" description="" />
</siteMapNode>
</siteMapNode>
Run Code Online (Sandbox Code Playgroud)
如果我使用ASP.NET菜单控件(使用StaticDisplayLevels = 2),我会得到:
| 主页| 节点1 | 节点2 |
是否有跳过"Home"并获取此菜单的属性(来自该站点地图):
| 节点1 | 节点2 |
?
我目前正在使用ADFS身份验证机制来验证用户身份.在这种情况下,我将authenticationmode设置为None而不是表单身份验证.用户成功登录后,声明对象将提供与loggedIn用户关联的角色数据,因此在这种情况下,站点地图角色属性将如何从声明对象中获取角色.你能解释一下如何使用securityTrimmingEnabled属性吗?
我使用自定义类ADFSRoleProvider.cs继承了RoleProvider类并重写了方法GetRolesForUser方法但是除非我设置了方法,否则不会调用该方法
<authentication mode="Forms"/>
Run Code Online (Sandbox Code Playgroud)
而这又不能与siteMapNode节点中提到的roles属性进行交互.
主要问题是在用户成功使用ADFS身份验证机制登录后,sitemap角色属性如何了解loggedIn用户的角色.
请提供一些代码示例和有关上述问题的帮助.