need to delete a user from the membership profile.

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.
Who is Participating?
Juan_BarreraConnect With a Mentor Commented:
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:

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

mathieu_cuprykAuthor Commented:
this is great
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.