Change ASP.net MVC 3 username

I am running the ASP.net MVC 3 web application and using the Provider Membership. I would like to know if it is possible to allow a user (or administrator) to change an existing username? I have not found a way to do this. The username is not an email address, but is confirmed to be unique until I try to assign a new name.

Any help would be appreciated!

+5
source share
1 answer

The membership provider does not provide a method for updating the username. You will need to either expand the supplier vendor method or interact directly with membership tables so that this change can be changed. However you come to this, keep in mind a few points

  • When updating, you will need to check the uniqueness of the username, like what happens when the user is created.

  • , , cookie AuthenticationTicket. , , cookie authTicket , . HttpContext.Identity.User.Name , - , .

+7

All Articles