Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extend aspnet membership forms authentication tables?

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

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?

like image 670
Garrett Fogerlie Avatar asked Jul 05 '12 12:07

Garrett Fogerlie


1 Answers

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.

You can also look at the SqlTableProfileProvider

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

like image 163
StuartLC Avatar answered Nov 11 '22 15:11

StuartLC