change password form in asp net c#

In previous post we have learned how to create simple login form and create registration form in asp.net using sql database with c# language.

In this asp.net post, we will learn how to create a change password form for already registered user. For change password user first need to register with detail and get username and password. After register user has to login with his username and password. if username and password march then change password  form loaded to user screen and user can change his password by verifying current password.

change password form in asp.net c#

change password form in asp.net c#

First create a sql table for store user registration detail. we have here created sql table “UserMst” like below:

Here is the sql script for UserMst table:

CREATETABLE[dbo].[UserMst]
(

[ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[Name] [nvarchar](50) NULL,
[SurName] [nvarchar](50) NULL,
[City] [nvarchar](50) NULL,
[Email] [nvarchar](50) NULL,
[Password] [nvarchar](50) NULL,

)

change password form in asp.net c#

change password form in asp.net c#

The html source code for change password form design.

The design asp.net form layout is:

change password form in asp.net c#

change password form in asp.net c#

Here, we first check the use current password, if matches then user can make new password or  we can also say change password.

we user required field validator control for all three textboxes and user compare validator for compare new password and confirm password field in change password asp.net example.

The c# code for change password button.

In above change password asp.net example we use  session["uname"] in update sql query for change password. When user login in to system with his username and password at that time if credential match then store username or email in session["uname"].

Leave a Reply

Your email address will not be published. Required fields are marked *

3 + 2 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">