Last post Jul 30, 2016 01:27 PM by arianit
Jul 27, 2016 07:23 PM|arianit|LINK
I'm working on a project to learn how Asp.Net MVC Authentication works. And one thing that bothers me is that the email is also getting set as the username. So how can I make the app to allow the user to choose the username he/she want and make it unique?
And by the way, when I make the username unique, how can I make the app to use it also as login like in facebook where you can either write your username or email?
Thanks in advance.
Jul 27, 2016 08:39 PM|march11|LINK
If you want to use either in ASP.net you will need to cook your own look ups to make this work.
You can use the CreateUser Wizard, available when you create an asp.net web site project, under the Login tool set in toolbox.
It will allow you or user to create any user name, I think you will need to code a test to see if its already in use.
You would also need to add code to the login control and test if user enters the user name or email and decide how you want to authenticate them with the Membership class.
Jul 28, 2016 03:27 AM|Yohann Lu|LINK
So how can I make the app to allow the user to choose the username he/she want and make it unique? And by the way, when I make the username unique
You can refer the following tutorials and solutions.
ASP.NET Identity 2.0.0 – UserName and Email separation:
Using User Name Instead of Email in ASP.NET Identity:
How to login with “UserName” instead of “Email” in MVC Identity:
how can I make the app to use it also as login like in facebook where you can either write your username or email?
I think, if you create your own login system, will be very simple.
Jul 30, 2016 01:27 PM|arianit|LINK
Can you provide me with expression check (like: @"^[A-Z]+[a-zA-Z''-'\s]*$"), to prevent spaces, to use just a single word username, allowing numbers and alphabets only? Thank you