我有一个简单的页面,我有一个登录按钮。我只是想以编程方式设置用户身份,以便当我重新导航到此页面或任何其他我可以得到... [英] I've got a simple page, and I have a login button. I simply want to programmatically set the User identity so that when I re-navigate to this page or any other I can get...
本文介绍了我有一个简单的页面,我有一个登录按钮。我只是想以编程方式设置用户身份,以便当我重新导航到此页面或任何其他我可以得到...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的页面,我有一个登录按钮。我只是想以编程方式设置用户身份,以便当我重新导航到此页面或任何其他我可以获得当前用户身份。是否有特殊注意事项?
I've got a simple page, and I have a login button. I simply want to programmatically set the User identity so that when I re-navigate to this page or any other I can get the current User identity. Are there special considerations for this?
推荐答案
使用会话
来存储用户详细信息并访问会话
变量无论你想要什么。
1. ASP.NET会话状态概述 [ ^ ]
2. 在ASP.NET中探索会话 [ ^ ]
UseSession
to store the User details and access theSession
variable wherever you want.
1. ASP.NET Session State Overview[^]
2. Exploring Session in ASP.NET[^]
这篇关于我有一个简单的页面,我有一个登录按钮。我只是想以编程方式设置用户身份,以便当我重新导航到此页面或任何其他我可以得到...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文