如何延长ASPNET成员窗体身份验证表? [英] How to extend aspnet membership forms authentication tables?

查看:152
本文介绍了如何延长ASPNET成员窗体身份验证表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,除了用户的用户名和电子邮件地址添加实名字段。

I would like to add a realName field in addition to the user's user name and email address.

在过去,我已经创建了一个新表,其中包含用户名实名列时,用户登记。不过,我想知道是否有可能延长默认asp.net表单验证会员表或用户表(或任何表是必要的,添加这),而不是为这些信息创建一个新表。

In the past I have created a new table that includes the username and realName columns when a user registers. However I would like to know if it is possible to extend the default asp.net forms authentication membership table or user table (or whatever table is necessary, to add this to) instead of creating a new table for this information.

问:我如何添加一个新列的认证表

Question: How can i add a new column to authentication tables?

推荐答案

您应该使用会员的用户配置文件 API自定义属性延伸到你的用户,而不是直接添加列到 aspnet_Membership aspnet_Users 表。

You should use the Membership User Profile API to extend custom properties to your users, and not directly add columns to the aspnet_Membership and aspnet_Users tables.

您还可以看看 SqlTableProfileProvider

和确保你这里如何极力营造阅读乔尔和Colivier帖子类型化的配置文件类。

And make sure you read Joel's and Colivier's posts here on how to create strongly typed profile classes.

这篇关于如何延长ASPNET成员窗体身份验证表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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