如何配合SqlRoleProvider到[我的"用户表 [英] How to tie SqlRoleProvider to "My" user table

查看:115
本文介绍了如何配合SqlRoleProvider到[我的"用户表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配合SqlRoleProvider到我的用户表

How to tie SqlRoleProvider to "My" user table

我使用asp.net MVC和SqlRoleProvider似乎工作开箱。不过,我有我自己的用户和角色。我有一个用户表中拥有所有用户/个性化的数据。我如何扎帐控制器回到我的表。我的表有一个用户ID,我用它来配合其他措施以特定用户。

I am using asp.net MVC and SqlRoleProvider appears to work out of the box. However I have my own users and roles. I have a user table the has all the user/personalized data. How do I tie the account controller back to my table. My table has a userID and I use that to tie other actions to a particular user.

将是巨大的,如果我可以使用该帐户的控制器,并在用户登录后,我有自己的ID。

Would be great if I could use the account controller and after the user logs in, I have their ID.

我一直在寻找这一点,但不是完全一样asp.net mvc的

I have been looking at this but is not quite the same as asp.net mvc

http://www.4guysfromrolla.com/articles/121405-1.aspx

推荐答案

不知道这是在asp.net mvc的是相同的,但我们使用 SqlMembership 提供商与认证给我们回的MembershipUser 对象。该的MembershipUser 实例有一个 ProviderUserKey 属性,我们映射到我们自己的用户表的会员id字段(这是不同于我们的内部用户ID)。

Not sure if this is the same in asp.net mvc, but we use the SqlMembership provider for authentication with gives us back a MembershipUser object. The MembershipUser instance has a ProviderUserKey property which we map to our own user table's MemberId field (which is different to our internal UserId).

这篇关于如何配合SqlRoleProvider到[我的"用户表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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