How to extend aspnet membership forms authentication tables?

I would like to add a realName field in addition to the username and email address.

In the past, I created a new table that includes the username and realName columns when a user logs in. However, I would like to know if it is possible to extend the standard asp.net authentication destination table or user table (or any other table to add this) instead of creating a new table for this information.

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

+6
source share
2 answers

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

You can also look at SqlTableProfileProvider

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

+9
source

If this is a web application project, you will need to use a custom profile class, since profiles will only be out of the box with the website model:

http://www.codersbarn.com/post/2008/07/10/ASPNET-PayPal-Subscriptions-IPN.aspx

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

+1
source

Source: https://habr.com/ru/post/919755/


All Articles