In this blog we will know how to change the old password to new password in asp.net.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="Change_password_in_asp._Default" %>
<!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>Untitled Page</title>
</head>
<body>
<form
id="form1"
runat="server">
<div>
<asp:Label ID="Label1" runat="server"
Text="Password:"
Width="150px"></asp:Label>
<asp:TextBox ID="txtpassword"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="txtpassword" ErrorMessage="RequiredFieldValidator">Password
cannot be blank</asp:RequiredFieldValidator>
<br />
<asp:Label ID="Label2" runat="server"
Text="New
Password:" Width="150px"></asp:Label>
<asp:TextBox ID="txtnpassword"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="txtnpassword" ErrorMessage="RequiredFieldValidator">NewPassword
cannot be blank</asp:RequiredFieldValidator>
<br />
<asp:Label ID="Label3" runat="server"
Text="Confirm New
Password:"
Width="150px"></asp:Label>
<asp:TextBox ID="txtcpassword"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="txtcpassword" ErrorMessage="RequiredFieldValidator">ConfirmPassword
cannot be blank</asp:RequiredFieldValidator>
<asp:CompareValidator
ID="CompareValidator1"
runat="server"
ControlToCompare="txtnpassword" ControlToValidate="txtcpassword"
ErrorMessage="CompareValidator">Not equal</asp:CompareValidator>
<br />
<asp:Button ID="btn_cpass"
runat="server"
Text="Change
password" />
<asp:Button ID="btn_clear"
runat="server"
Text="Clear"
/>

Join the conversation! Your thoughts help the community grow.