且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

重定向管理员管理页面和用户到用户的页面

更新时间:2023-12-04 18:37:58

刚刚看到您的重新编辑的问题...什么是你的导航的样子? 控制的你用什么?什么样的的的MembershipProvider 的(如果有的话),你呢?

Just saw your re-edited question... What is your navigation like? What controls do you use? what kind of MembershipProvider (if any) do you use?

您仍可以尝试使用一个TreeView或菜单控件(绑定到一个站点地图文件)。使用这些控件,您可以使用 securityTrimming (见 MSDN 了解详细信息)。

You may still try to use a treeView or a menu control (bound to a sitemap file). Using these controls allows you to make use of securityTrimming (see msdn for details).

例如(从MSDN):

<system.web>
<!-- …other configuration settings -->
  <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
    <providers>
      <add name="XmlSiteMapProvider"
        description="Default SiteMap provider."
        type="System.Web.XmlSiteMapProvider "
        siteMapFile="Web.sitemap"
        securityTrimmingEnabled="true" />
    </providers>
  </siteMap>
</system.web>

此属性将改变出现在您的导航控件链接的可见性。例如用户与角色管理 - 只看到他们被允许浏览到这些链接

This attribute will change the visibility of links appearing in your navigation controls. For example users with a role admin - will only see those links they are allowed to navigate to.

能否请您告诉我们您的导航控件?
THX提前

Could you please show us your navigation controls? thx in advance

  • Controls (Login, LoginStatus, ...)
  • Understanding Role Management (how to ... membershipProvider, roles, aso)