How to use ChangePassword control in asp.net

ChangePassword Web Server Control
ChangePassword is an asp.net web server control. ChangePassword control enables web site users to change the passwords they use to log in the web site.

ChangePassword server control uses the membership provider defined by the MembershipProvider property to change the password stored in the membership provider data store. ChangePassword control uses the default membership provider, if a membership provider does not assigned by web developers.

we can configure ChangePassword control to use email services to send the new password to the user. to send users new password to their email address, we must configure an email server in the Web.config file for an asp.net application.

ChangePassword control has two states or views, change password view and success view. the change password view request the current password and require to input new password twice. success view display confirmation that the password has been changed.

the following asp.net c# example code demonstrate us how can we use ChangePassword web server control in an asp.net application.
ChangePasswordExample.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ChangePassword control example: how to change password in asp.net</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LoginStatus ID="LoginStatus1"  runat="server"/>
        <br />
        <asp:LoginName ID="LoginName1" runat="server" FormatString="Hi {0}!" Font-Size="XX-Large" ForeColor="BurlyWood" />
        <br /><br />
        <asp:ChangePassword ID="ChangePassword1" runat="server" ></asp:ChangePassword>
    </div>
    </form>
</body>
</html>
More asp.net examples