Monday, October 3, 2016

ASP.Net Membership, Create User and Invalid Email. What?

I was testing ASP.Net Membership user registration logic in my server. It runs fine till it throws "The E-mail supplied is invalid" error. Weird thing is I found out that all my data are correct through debugging and double checking my entry. Quick search says that requiresUniqueEmail attribute on Membership provider tag set to true is the problem. Ironically, I only have one email in the database.

Brushing my confusion aside, I remove the attribute, but it still doesn't work. And eventually found out that setting requiresUniqueEmail="false" fixed the whole thing.

Later on I also found out that by default, the attribute has value of true. That explains why removing the attribute doesn't work.


I have yet found out why it doesn't work when it has true value and no data in the database. Hopefully one day when I have time to dig deeper.

No comments:

Post a Comment