-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserEdit.aspx
124 lines (123 loc) · 11 KB
/
UserEdit.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<%@ Page Title="" Language="C#" MasterPageFile="~/UserMaster.master" AutoEventWireup="true"
CodeFile="UserEdit.aspx.cs" Inherits="UserEdit" %>
<asp:Content ID="ContentHead" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="ContentBody" ContentPlaceHolderID="BodyContent" runat="Server">
<div class="container-fluid py-5">
<div class="row justify-content-center align-items-center">
<div class="col-8">
<div class="card custom1">
<div class="p-3 border-0">
<span class="card-title display-6">Edit Profile</span>
</div>
<div class="card-body row justify-content-center">
<div class="col">
<div class="form-group py-2">
<asp:TextBox ID="txtName" runat="server" class="form-control" placeholder="Full Name"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtNameVal" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ErrorMessage="Required"
ControlToValidate="txtName"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="txtNameRVal" Display="Dynamic" ValidationGroup="valGpOne"
runat="server" ControlToValidate="txtName" ErrorMessage="Only Characters" Style="font-weight: normal;
font-size: small; color: Red;" ValidationExpression="[a-zA-Z\s]+"></asp:RegularExpressionValidator>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtAddress" runat="server" TextMode="MultiLine" class="form-control"
placeholder="Address"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtAddressVal" ValidationGroup="valGpOne" runat="server"
Display="Dynamic" Style="font-weight: normal; font-size: small; color: Red;"
ErrorMessage="Required" ControlToValidate="txtAddress"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="txtAddressRVal" Display="Dynamic" ValidationGroup="valGpOne"
runat="server" ControlToValidate="txtAddress" ErrorMessage="Use only alphanumerics, spaces - and , !" Style="font-weight: normal;
font-size: small; color: Red;" ValidationExpression="[a-zA-Z\s\-\,\d]+"></asp:RegularExpressionValidator>
</div>
<div class="form-group py-3">
<asp:TextBox ID="txtdob" runat="server" ReadOnly="true" autocomplete="off" ClientIDMode="Static"
MaxLength="10" CssClass="form-control" placeholder="Date Of Birth"></asp:TextBox>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtGender" ReadOnly="true" autocomplete="off" runat="server" class="form-control"
placeholder="Gender"></asp:TextBox>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtEmail" autocomplete="off" runat="server" class="form-control"
placeholder="Email Id"></asp:TextBox>
<asp:RequiredFieldValidator Display="Dynamic" ID="txtEmailVal" runat="server" ControlToValidate="txtEmail"
Style="font-weight: normal; font-size: small; color: Red;" ValidationGroup="valGpOne"
ErrorMessage="Required" />
<asp:RegularExpressionValidator ID="txtEmailVal1" Display="Dynamic" runat="server"
ControlToValidate="txtEmail" Style="font-weight: normal; font-size: small; color: Red;"
ValidationExpression="^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
ValidationGroup="valGpOne" ErrorMessage="Invalid email address" />
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtUser" runat="server" ReadOnly="true" autocomplete="off" placeholder="Username"
class="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtUserVal" Display="Dynamic" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ErrorMessage="Required"
ControlToValidate="txtUser"></asp:RequiredFieldValidator>
</div>
</div>
<div class="col">
<div class="form-group py-2">
<asp:TextBox ID="txtNewPass" runat="server" TextMode="Password" class="form-control"
placeholder="New Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtNewPassVal" Display="Dynamic" ValidationGroup="valGpOne"
runat="server" Style="font-weight: normal; font-size: small; color: Red;" ErrorMessage="Required"
ControlToValidate="txtNewPass"> </asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="txtNewPassRVal" ValidationGroup="valGpOne" Display="Dynamic"
runat="server" ControlToValidate="txtNewPass" Style="font-weight: normal; font-size: small;
color: Red;" ErrorMessage="Minimum password length is 8" ValidationExpression=".{8}.*" />
<asp:CompareValidator ID="txtNewPassCOVal" runat="server" Style="font-weight: normal; font-size: small;
color: Red;" ValidationGroup="valGpOne" ControlToValidate="txtNewPass" ErrorMessage="Select a new password!" Display="Dynamic" Operator="NotEqual"></asp:CompareValidator>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtPassConf" runat="server" TextMode="Password" class="form-control"
placeholder="Confirm Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtPassConfVal" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ErrorMessage="Required"
ControlToValidate="txtPassConf"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="txtPassConfRVal" Display="Dynamic" runat="server"
ControlToValidate="txtPassConf" Style="font-weight: normal; font-size: small;
color: Red;" ValidationGroup="valGpOne" ErrorMessage="Minimum password length is 8"
ValidationExpression=".{8}.*" />
<asp:CompareValidator ID="txtPassConfCVal" Display="Dynamic" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ControlToCompare="txtNewPass"
ErrorMessage="Passwords do not match!" ControlToValidate="txtPassConf"></asp:CompareValidator>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtPhone" runat="server" class="form-control" placeholder="Phone Number"
MaxLength="10"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtPhoneVal" Display="Dynamic" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ErrorMessage="Required"
ControlToValidate="txtPhone"> </asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="txtPhoneRVal" runat="server" Display="Dynamic"
Style="font-weight: normal; font-size: small; color: Red;" ValidationGroup="valGpOne"
ControlToValidate="txtPhone" ErrorMessage="Invalid Phone Number" ValidationExpression="[0-9]{10}"></asp:RegularExpressionValidator>
</div>
<div class="form-group py-2">
<asp:TextBox ID="txtOldPass" runat="server" TextMode="Password" class="form-control"
placeholder="Old Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="txtOldPassVal" Display="Dynamic" ValidationGroup="valGpOne"
runat="server" Style="font-weight: normal; font-size: small; color: Red;" ErrorMessage="Required"
ControlToValidate="txtOldPass"> </asp:RequiredFieldValidator>
<asp:CompareValidator ID="txtOldPassCVal" Display="Dynamic" runat="server" Style="font-weight: normal;
font-size: small; color: Red;" ValidationGroup="valGpOne" ErrorMessage="Passwords do not match!"
ControlToValidate="txtOldPass"></asp:CompareValidator>
<asp:RegularExpressionValidator ID="txtPassRVal" ValidationGroup="valGpOne" Display="Dynamic"
runat="server" ControlToValidate="txtOldPass" Style="font-weight: normal; font-size: small;
color: Red;" ErrorMessage="Minimum password length is 8" ValidationExpression=".{8}.*" />
</div>
<asp:Button ID="btnUserUpdate" runat="server" ValidationGroup="valGpOne" class="btn btn-outline-primary me-2"
Text="Update" OnClick="btnUserUpdate_Click" />
<input type="reset" class="btn btn-outline-secondary" value="Clear" />
<br />
<asp:Label ID="lblUpdateOK" runat="server" Text="You have successfully updated your details."
Font-Bold="True" ForeColor="Red" Visible="False"></asp:Label>
</div>
</div>
</div>
</div>
</div>
</div>
</asp:Content>