登录和注销重定向 [英] Login and Logout Redirection

查看:162
本文介绍了登录和注销重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Web窗体登录。该应用程序有三个角色,管理员,专家和会员。我想重新定向到不同的子页面的每个。我也希望能够重新定向到主页上登出。

I have a simple Web Forms login. The application has three roles, Admin, Expert and Member. I want to re-direct to a different sub-page for each. I also want to be able to re-direct to home page on logout.

我这里问过类似的问题,但解决方案覆盖了LoginStatus LogoutPageUrl属性。任何人都可以建议如何做到这一点?

I've asked a similar question here, but the solution overrode the LoginStatus LogoutPageUrl attribute. Can anyone suggest how to do this?

更新2012年12月28日

到目前为止,这个我已经找到了唯一的解决方案是创建一个包含安全修整链接到不同的目的地的页面新的菜单页面。离开这个问题打开了一会儿,征求反馈/替代解决方案...

So far, the only solution to this I have found is to create a new menu page containing security-trimmed links to the different destination pages. Leaving this question open for a while to elicit feedback / alternative solutions...

推荐答案

到目前为止,这个我已经找到了唯一的解决方案是创建一个包含安全修整链接到不同的目的地的页面新的菜单登陆(目标)页面。

So far, the only solution to this I have found is to create a new menu landing (destination) page containing security-trimmed links to the different destination pages.

protected void Page_Load(object sender, EventArgs e)
{
    if(User.IsInRole("Admin"))
        adminLink.Visible = true;

    if ((User.IsInRole("Member")) || (User.IsInRole("Admin")))
        questionsLink.Visible = true;
}

这篇关于登录和注销重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆