One user with more than one mail on ASP.NET Membership Provider
i need to know this.. in the asp.net membership provider, it is possible to create a use开发者_Python百科r with more than one mail? The thing is that i want in my page (ASP.NET MVC 3) the users can have various emails to login.
It's this possible?
Thanks!
Membership Provider is limited to 1 email account per account holder. You can attach custom attributes for each account using Membership Profile. So your secondary email would simply be an attribute of the user's profile. Here is a great article explaining how to do this.
It is possible, but not with any of the built-in membership providers. You will need to implement your own. Just know that your design will come down to ensuring that e-mail is unique in the table and is linked to a single user account (many-to-one). This will require a separate table in the database for the many e-mails a user may have.
With the default membership providers, no. An email address maps to one user. You can however implement your own membership provider that will take care of this situation.
I'd argue its not a job for the membership provider -- multiple email addresses smell like an application-layer concern.
精彩评论