hi
i have 3 textbox 1 button and in my change password.aspx
1-Txtold== user should enter their old password
2-Txtnew1== usershould enter their new password
3-Txtnew2==user should retype their new password
and House_info table
name
|
password
|
behcode
|
Id
|
sara
|
12345
|
1111
|
1
|
Now i want when users click on button at first check that Txtold value if that was equal with password column it will change password column with Txtnew1 value
i wrote below code
protected void Imgpass_Click(object sender, ImageClickEventArgs e) { string data=Server.UrlDecode(Request.QueryString["Behcode"]); SqlCommand _cmd=new SqlCommand("changepassword",_cn); _cmd.CommandType=CommandType.StoredProcedure; _cn.Open(); _cmd.Parameters.AddWithValue("@behcode",data); _cmd.Parameters.AddWithValue("@Oldpass",Txtold.Text); _cmd.Parameters.AddWithValue("@Newpass",Txtnew1.Text); _cmd.ExecuteNonQuery(); Session["Message"] = true; Response.Redirect(Request.Url.AbsoluteUri); _cn.Close(); }
SP
create procedure dbo.changepassword @behcode nvarchar(10) ,@Oldpass nvarchar(20) ,@Newpass nvarchar(20) as begin update House_info set password=@Newpass where BehCode=@behcode and password=@Oldpass end
it worked correctly but i want if users don't enter their old password in Txtold textbox correctly it show message that for changing password they should enter their old password correctly
how i can do it
thanks