So, I’m working through a basic membership management admin panel but I can’t quite figure out how to delete a user account. I can create one easily enough with the WebSecurity class, but this class doesn’t appear to have any functions to delete an account.
What exactly do i have to do to get this functionality?
Edit: If you are using ASP.NET Web Pages 2 you are now able to accomplish the above by calling the DeleteUser() and DeleteAccount() functions available in WebMatrix.WebData.SimpleMembershipProvider. If you are using ASP.NET Web Pages 1 the answer is still valid. Refer to the SimpleMembershipProvider Class MSDN documenation for more information.
You will have to write your own code to delete the account. It’s simply an entry in your database, so use the Database helper to remove the relevant rows from the webpages_UserInRoles,webpages_Membership and UserProfile tables.