ASP.NET(vb.net) & ChangePassword - The ChangePassword control allows users to change their password. The user must first supply the original password and then create and confirm the new password. If the original password is correct, the user password is changed to the new password. The control also includes support for sending an e-mail message about the new password.
ShotDev Focus:
- ASP.NET(vb.net) & ChangePassword
Example
Login.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> <div> <asp:LoginView ID="LoginView1" runat="server"> <AnonymousTemplate> Please Login <br /> <asp:Login ID="Login1" runat="Server" DestinationPageUrl="Login.aspx" /> </AnonymousTemplate> <LoggedInTemplate> Welcome [<asp:LoginName ID="LoginName1" runat="server" />] , <asp:LoginStatus ID="LoginStatus1" runat="server" /> <br /> <asp:HyperLink ID="HyperLink1" NavigateUrl="~/ChangePassword.aspx" runat="server">Change Password</asp:HyperLink><br /> </LoggedInTemplate> </asp:LoginView> </div> </form> </body> </html>
Login.aspx.vb
Partial Class Login Inherits System.Web.UI.Page End Class
ChangePassword.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ChangePassword.aspx.vb" Inherits="ChangePassword" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>ShotDev.Com Tutorial</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ChangePassword ID="ChangePassword1" runat="server"> </asp:ChangePassword> </div> </form> </body> </html>
ChangePassword.aspx.vb
Partial Class ChangePassword Inherits System.Web.UI.Page End Class
Screenshot
Login Form
Click Change Password.
3respond…
…