Is there a way to configure ASP.NET SqlMembershipProvider such that Email is optional but when provided must be unique?
I only found the requiredUniqueEmail attribute (web.config) which makes Email mandatory. Do I have to leave this out and implement checking for existing email addresses myself in the account registration process?
Or is there a nicer way to handle this scenario?
An easy, but probably risky way, is to modify the stored procedure directly to do this.
Modify
aspnet_Membership_CreateUserby replacing:with
I say it’s risky because nobody would expect you to modify this and you’d better document the change well.