views:

460

answers:

3

I am using the default sql membership provider with ASP.NET and I would like to provide a page to change the user's username. I believe I am sure I could do this with a custom provider, but can this be done with the default provider?

Second part of my question is: Should I allow users to change their username after the account is created?

A: 

No, the MembershipUser class does not allow to modify the Username property so you cannot do it.

Practically you should not allow the username to change. If you allow to do so somehow then it will lose its purpose and nature.

this. __curious_geek
I ended up writing my own provider. then I added this ability.
Bobby Ortiz
it does not lose its purpose or nature at all. lets say you create [email protected] for an account. oops you mispelled geek! now you're totally screwed. customers will do this ALL the time. if you're using email as login you have a problem
Simon_Weaver
+5  A: 

It's true that the default SQL Membership Provider does not allow username changes. However, there's no intrinsic reason to prevent users from changing their usernames if you have a valid argument, on your site, to allow it. None of the tables in the SQL database have the username as a key, everything is based on the user's ID, so from an implementation perspective it would be fairly easy.

Jon Freeland