I am using ASP.NET Identity and want to check only if username already exists. But it check email as well and gives error for both (Email and Username). I want to check only Username. How i can do it. Below is the error. Name customer@test.com is already taken. Email customer@test.com is already taken. It should show only one statement either email or name.
Asked
Active
Viewed 413 times
0
-
2Welcome to SO. Why don't you post your code? – heuristican May 15 '20 at 05:33
-
can you follow the [link](https://stackoverflow.com/questions/27501533/use-username-instead-of-email-for-identity-in-asp-net-mvc5) and let me know if it works – Prakash May 15 '20 at 05:33
1 Answers
0
You can use JavaScript to validate on lose focus of the username field. Here is an easy example for reference https://www.codeproject.com/Tips/1104856/Validate-Email-ID-in-ASP-NET-TextBox-using-JavaScr

Praveen Kumar
- 113
- 3
- 11
-
Thank you for your reply. I am using Identity and it is functionality of Identity to avoid duplication user name / email. I want to use that but only for username not email. – Mohammad Adnan May 15 '20 at 05:52