简体   繁体   中英

Custom Membership Provider for asp.net using c#

How i can realise my own Membership Provider for my social network example project where i want to use more extended registration with new fields? Thanks.

Membership Providers are not meant for holding user profile details, their purpose is to give your application a mechanism for authentication and user-management - that's it. Like, Fermin correctly said, create a seperate table with one-to-one relation with your primary membership provider table on its UserId. Given this fact, you actually don't need a custom membership provider unless your member provider has to work against a different table with different schema for holding membership details.

You could use the default Memership Provider details and create another table to store the extended registration details that you need to store.

You can then have a foreign key in this new table storing a link to the Membership Provider User table. You can then link back to this and update,view,insert and of the extra information as and when you need to?

You can add a ProfileProvider which works with and extends the MembershipProvider. Have a look at this blog from Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2006/01/10/435038.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM