主页面中的登录链接 [英] login link in master page

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

问题描述





在母版页中,我有一个登录链接,登录后我需要将其更改为注销,这是可能的吗?怎么样?



谢谢,

Rami

Hi,

In the master page i have a link for "login", after login i need this to be changed to "logout", is this possible and how?

Thanks,
Rami

推荐答案

只有一些细节,例如语言,身份验证提供者等等...不能认为它是标准的ASP.NET / C#姿态:)



这可以通过检查用户是否可以实现是否经过验证,如果是,则更改控件的文本和URL。



使用ASP.NET用户/角色,可以通过以下方式完成:



With few details, such as language, authentication proivders, etc... ill assume its the standard ASP.NET/C# stance :)

This could be achieved by checking if the user is authenicated and if they are, change the text and url of the control.

Using ASP.NET Users/Roles, this can be done by:

if(HttpContext.Current.User.Identity.IsAuthenticated)
{
// change text to 'logout' and update URL
}
else
{
// change text to 'login' and update URL
}







-DB




-DB


这篇关于主页面中的登录链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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