protected void btnsubmit_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = CommanDataLoad.ExecuteDataSet("Select * from usr_login where UserId='" + HttpContext.Current.Session["UserId"] + "'", "2", "Change_password", ""); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { string str1 = CommanDataLoad.DecryptPassword(Convert.ToString(ds.Tables[0].Rows[0]["pass"].ToString())); if (txtOldPassword.Text == str1) { if (txtNewPassword.Text == txtConfirmPassword.Text) { string str = "update usr_login set pass='******' where UserId='" + HttpContext.Current.Session["UserId"] + "'"; CommanDataLoad.ExecuteNonQuery(str, "2", "Change Pass", ""); Lblmessage.Text = "Your Password Changed Successfully...!!!"; Response.Redirect("Default.aspx?msg=Password changed successfully...!"); } } else { Lblmessage.Text = "Please enter correct current password...!!!, Please login now with new password..!"; } } } }