ChangePassword Template : ChangePassword « Login Security « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » Login Security » ChangePassword 




ChangePassword Template

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.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:ChangePassword ID="ChangePassword1" runat="server">
            <ChangePasswordTemplate>
                <table border="0" cellpadding="1">
                    <tr>
                        <td>
                            <table border="0" cellpadding="0">
                                <tr>
                                    <td align="center" colspan="2">
                                        Change Your Password</td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label 
                                             ID="CurrentPasswordLabel" 
                                             runat="server" 
                                             AssociatedControlID="CurrentPassword">Password:</asp:Label></td>
                                    <td>
                                        <asp:TextBox 
                                             ID="CurrentPassword" 
                                             runat="server" 
                                             TextMode="Password"></asp:TextBox>
                                        <asp:RequiredFieldValidator 
                                             ID="CurrentPasswordRequired" 
                                             runat="server" 
                                             ControlToValidate="CurrentPassword"
                                             ErrorMessage="Password is required." 
                                             ToolTip="Password is required." 
                                             ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label 
                                             ID="NewPasswordLabel" 
                                             runat="server" 
                                             AssociatedControlID="NewPassword">New Password:</asp:Label></td>
                                    <td>
                                        <asp:TextBox 
                                             ID="NewPassword" 
                                             runat="server" 
                                             TextMode="Password"></asp:TextBox>
                                        <asp:RequiredFieldValidator 
                                             ID="NewPasswordRequired" 
                                             runat="server" 
                                             ControlToValidate="NewPassword"
                                             ErrorMessage="New Password is required." 
                                             ToolTip="New Password is required."
                                             ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator 
                                             ID="RegularExpressionValidator1" 
                                             runat="server" 
                                             ControlToValidate="NewPassword"
                                             ErrorMessage="Must have at least 1 number, 1 special character, and more than 6 characters."
                                             ValidationExpression="(?=^.{6,}$)(?=.*\d)(?=.*\W+)(?![.\n]).*$">*</asp:RegularExpressionValidator></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label 
                                             ID="ConfirmNewPasswordLabel" 
                                             runat="server" 
                                             AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label></td>
                                    <td>
                                        <asp:TextBox 
                                             ID="ConfirmNewPassword" 
                                             runat="server" 
                                             TextMode="Password"></asp:TextBox>
                                        <asp:RequiredFieldValidator 
                                             ID="ConfirmNewPasswordRequired" 
                                             runat="server" 
                                             ControlToValidate="ConfirmNewPassword"
                                             ErrorMessage="Confirm New Password is required." 
                                             ToolTip="Confirm New Password is required."
                                             ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2">
                                        <asp:CompareValidator 
                                             ID="NewPasswordCompare" 
                                             runat="server" 
                                             ControlToCompare="NewPassword"
                                             ControlToValidate="ConfirmNewPassword" 
                                             Display="Dynamic" 
                                             ErrorMessage="The Confirm New Password must match the New Password entry."
                                             ValidationGroup="ChangePassword1"></asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2" style="color: red">
                                        <asp:Literal 
                                             ID="FailureText" 
                                             runat="server" 
                                             EnableViewState="False"></asp:Literal>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Button 
                                             ID="ChangePasswordPushButton" 
                                             runat="server" 
                                             CommandName="ChangePassword"
                                             Text="Change Password" 
                                             ValidationGroup="ChangePassword1" />
                                    </td>
                                    <td>
                                        <asp:Button 
                                             ID="CancelPushButton" 
                                             runat="server" 
                                             CausesValidation="False" 
                                             CommandName="Cancel"
                                             Text="Cancel" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ChangePasswordTemplate>
        </asp:ChangePassword>
        <br />
    </form>
</body>
</html>

 














Related examples in the same category
1.ChangePassword control enables end users to change their passwords directly in the browser
2.Change the password for the current user
3.Set CancelButtonStyle, ChangePasswordButtonStyle, ContinueButtonStyle, PasswordHintStyle, InstructionTextStyle
4.Password must be 8 characters long and includes two numbers and two special character
5.ChangePassword style
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.