SaaS CMS has officially launched! Learn more now.

Can't delete programmatically created user



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 "" instead of "". If I go to the used url directly, /secure/ui/CMS/admin/DeleteMembershipDialog.aspx? and change the username to, the user can be deleted.

Any ideas on how to solve this?

Best regards,


Jan 02, 2013 17:47

Does it work if you create a user with an email address as user name from the admin interface?

Jan 04, 2013 12:28

Yes, it all works fine when created in adminmode. The problem is when creating the user from code.

Jan 04, 2013 21:11

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?

Jan 07, 2013 10:50

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.

Jan 07, 2013 11:12

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.

The bug is in line 131 where the call to the javascript function OpenDeleteDialog has a Server.UrlEncode(MembershipUser.Value) statement that should just be MembershipUser.Value without encoding.

Edited, Jan 07, 2013 11:56
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.