I'm creating users programmatically via a register function. All goes well, but if I want to delete these users I can't do so in Adminmode. I'm experiencing the same problem both in our site and when extending the Alloysite. When I click on delete, the username seems to be urlencoded, for example as "name%40mysite.se" instead of "firstname.lastname@example.org". If I go to the used url directly, /secure/ui/CMS/admin/DeleteMembershipDialog.aspx?NameRoleOrUser=name%40mysite.se&SecurityEntity=0&ProviderName=SqlServerMembershipProvider and change the username to email@example.com, the user can be deleted.
Any ideas on how to solve this?
Does it work if you create a user with an email address as user name from the admin interface?
Yes, it all works fine when created in adminmode. The problem is when creating the user from code.
I also made sure so that the email is not encoded when saving the new user. Any ideas on this,is this a bug or something we're doing wrong?
I reproduced this now, but the strange thing is that in the installation where I did I can't delete users created in admin mode either... I will research futher but I'm thinking it's probably a bug.
Yes it is a bug that has been fixed. You can contact support and request a hotfix for bug #91051, or you can try to work around it youself.
The bug is in UserMembership.ascx which is in the UI/CMS/Edit path of the episerver installation (e.g. Program Files (x86)\EPiServer\CMS\7.0.586.1\Application\UI\CMS\Edit). If you change this file directly you have to remember to do so on every machine where your site is going to run.
A (better) alternative is to copy this file to your site project and change it there, and then use the virtual path mapper to replace the file with your version. Check EPiServerFramework.config in a default Alloy installation which has a commented-out example of how to use the virtualPathMappings element and the VirtualPathMappedProvider.