need to delete a user from the membership profile.

Posted on 2008-11-11
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

    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


    Author Comment

    this is great

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now