以编程方式访问成员UserId? [英] Accessing membership UserId programmatically?

查看:98
本文介绍了以编程方式访问成员UserId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户登录后(ASP.NET 2.0成员资格/角色),我如何以编程方式访问他们的UserId和存储在

中的其他信息?数据库结构?用户可以登录Login.aspx并

然后将它们重定向到somepage.aspx。 somepage.aspx没有

a对登录对象的引用,也无法访问UserId。


另外,更改是否有任何问题从一个

uniqueidentifier到一个整数IDENT的UserId列?


谢谢。

解决方案



所有会员服务都可以通过

System.Web.Security.Membership类以编程方式访问。


我不建议更改MS用于

会员信息的数据库架构。我的直觉是那会很糟糕。


Jason Vermillion


" perplexed"写道:


用户登录后(ASP.NET 2.0会员/角色),我如何以编程方式访问他们的UserId和其他的
信息存储在

的ASP.NET数据库结构中?用户可以登录Login.aspx并

然后将它们重定向到somepage.aspx。 somepage.aspx没有

a对登录对象的引用,也无法访问UserId。


另外,更改是否有任何问题UserId列从

uniqueidentifier到整数IDENT?


谢谢。


感谢。我想显示一个更友好的用户ID。你知道一个

的方式我可以生成一个而不会打扰会员/角色

数据库架构吗?

向数据库添加一列并显示该列。


Juan T. Llibre,asp.net MVP

asp.net faq: http://asp.net.do/faq/

foros de asp.net,en espa?ol: http://asp.net.do / foros /

===================================

困惑 < jo *** @ bigstring.comwrote in message

news:11 ********************* @ h3g2000cwc.googlegrou ps。 com ...


谢谢。我想显示一个更友好的用户ID。你知道一个

的方式我可以生成一个而不会打扰会员/角色

数据库架构吗?



After a user logs in (ASP.NET 2.0 membership/roles), how do I
programmatically access their UserId and other information stored in
the ASP.NET database structure? A user may login at Login.aspx and
then they are redirected to somepage.aspx. somepage.aspx doesn''t have
a reference to the login object and can''t access UserId.

Also, are there any issues with changing the UserId column from a
uniqueidentifier to an integer IDENT?

Thanks.

解决方案


All of the membership services can be accessed programmatically via
System.Web.Security.Membership class.

I would not recommend changing the database schema that MS uses for
membership info. My gut feeling is that would be bad.

Jason Vermillion

"perplexed" wrote:

After a user logs in (ASP.NET 2.0 membership/roles), how do I
programmatically access their UserId and other information stored in
the ASP.NET database structure? A user may login at Login.aspx and
then they are redirected to somepage.aspx. somepage.aspx doesn''t have
a reference to the login object and can''t access UserId.

Also, are there any issues with changing the UserId column from a
uniqueidentifier to an integer IDENT?

Thanks.


Thanks. I''d like to display a more friendly userid. Do you know of a
way I can generate one without disturbing the membership/roles
database schema?


Add a column to the database and display that.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"perplexed" <jo***@bigstring.comwrote in message
news:11*********************@h3g2000cwc.googlegrou ps.com...

Thanks. I''d like to display a more friendly userid. Do you know of a
way I can generate one without disturbing the membership/roles
database schema?



这篇关于以编程方式访问成员UserId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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