protected void btnSubmit_Click(object sender, EventArgs e) { DataTable dts = objdataaccess.GetDatatable("Select * from tblCustomer where CustomerID=" + Session["CustomerID"]); if (dts.Rows.Count > 0) { hidden_oldpass.Value = dts.Rows[0]["Password"].ToString(); if (txtCurrentPassword.Text == hidden_oldpass.Value) { objCustomer.UpdateCustomerPassword(Convert.ToInt32(Session["customerID"].ToString()), txtCurrentPassword.Text, txtConfirmPassword.Text); Page.RegisterStartupScript("Msg1", "<script>alert('Password changed successfully !!!');</script>"); clear(); } else { Page.RegisterStartupScript("Msg1", "<script>alert('Current password is not valid !!!');</script>"); } } }