need to delete a user from the membership profile.

Posted on 2008-11-11
Medium Priority
Last Modified: 2012-05-05
Delete Account:

If a user wants to leave and wants her information and profile erased, they dont have to bother you. You can place a delete account link on the member area. Dont worry, if they accidentally click on this link, they will be asked for confirmation.

I would like to delete a user from the membership table.
Question by:mathieu_cupryk
LVL 20

Accepted Solution

Juan_Barrera earned 2000 total points
ID: 22937820
Hi again Mathieu,
You can delete an user (in the example, the current one), using the following code.
It will delete everything. To provide confirmation, you can use a ConfirmButton, whick is part of the AjaxControlToolkit: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ConfirmButton/ConfirmButton.aspx

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Membership.DeleteUser(Membership.GetUser.UserName, True)
    End Sub
 <asp:Button ID="Button1" runat="server" Text="Delete user" />
        <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" TargetControlID="Button1" ConfirmText="Are you sure?" runat="server" >

Open in new window


Author Comment

ID: 22971466
this is great

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question