使用user.identity.name [英] use of user.identity.name

查看:120
本文介绍了使用user.identity.name的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何使用user.identity.name在登录页面中使用当前登录用户的名称,而不是在asp.net中使用loginname控件.

how can we use user.identity.name to have a name of a current login user in the logged in page instead of using loginname control in asp.net

推荐答案

您可以使用会话,并在用户登录时将用户信息保存在会话中,并在需要时检索它,并在使用注销时将该值设置为null.
You can use sessions and save the user information in sessions when the user logs in and retrieve it whenever you need it and make the set the value to null when the use log out.


您可以使用会话变量来存储管理员的类型,并在使用这些页面时检查该会话变量.

该变量可以存储admin或user,以便更易于检查.
you can use a session variable to store the type of administrators and check that session variable when those pages are used.

the variable can store either admin or user so that it''ll be easier to check.


这篇关于使用user.identity.name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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