开发者

userid from asp.net Membership Authentication?

开发者 https://www.devze.com 2023-03-02 17:06 出处:网络
I\'m using the asp.net login control for user authentication. I also have the userID in many tables in my application and for now (development purposes), the userID is an int that I\'m making up.

I'm using the asp.net login control for user authentication. I also have the userID in many tables in my application and for now (development purposes), the userID is an int that I'm making up. However, I'd like to start using the userID of the framework in my tables. Where and how do I access the ac开发者_如何学Pythontual userID and what's its datatype?


Use the ProviderUserKey member of the MembershipUser object, like this:

MembershipUser user = Membership.GetUser();
string id = user.ProviderUserKey.ToString();


In the aspnet_Users Table there is a UserId field with the uniqueidentifier datatype.

You could add the membership table into your own database instead of a separated one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号