protected void lnkResetPassword_Click(object sender, EventArgs e)
    {
        lblMessage.Text = "";
        CryptoGraphy objEncrypt = new CryptoGraphy();

        lnkResetPassword.Enabled   = false;
        objLogin.intRegistartionID = Convert.ToInt32(ViewState["UserID"]);
        dt = objLoginDB.GetDataTable(objLogin, DA_Login.Login_1.UserDetails);
        if (dt.Rows.Count > 0)
        {
            string oldPass = objEncrypt.Decrypt(Convert.ToString(dt.Rows[0]["vchrPassword"]));
            if (txtOldPassword.Text.Trim() == Convert.ToString(objEncrypt.Decrypt(Convert.ToString(dt.Rows[0]["vchrPassword"]))))
            {
                objregistration.RegistrationId = Convert.ToInt32(ViewState["UserID"]);
                objregistration.Password       = objEncrypt.Encrypt(txtNewPassword.Text.Trim());
                objLoginDB.AddEditDel_RegistrationDetails(objregistration, DA_Login.Login_1.SelectForUser);

                objLoginDB.AddAndGetLoginDetails(objLogin, DA_SKORKEL.DA_Login.Login_1.ChangePassword);

                //   lblMessage.Text = "Password updated successfully.";
                //  lblMessage.CssClass = "GreenErrormsg";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Yelert", "showSuccessPopupRstPwd('Success','Password updated successfully.')", true);
                lnkResetPassword.Enabled = true;
                //remember me cookie removed .
                //Response.Cookies["myScrlCookie"].Expires = DateTime.Now.AddDays(-1);
                //Response.Cookies["myScrlCookie"].Values.Add("Password", objregistration.Password.ToString());

                if (Request.Cookies["myScrlCookie"] != null)
                {
                    Response.Cookies["myScrlCookie"].Values.Add("UserID", Request.Cookies.Get("myScrlCookie").Values["UserID"].ToString());
                    Response.Cookies["myScrlCookie"].Values.Add("UserName", Request.Cookies.Get("myScrlCookie").Values["UserName"].ToString());
                    Response.Cookies["myScrlCookie"].Values.Add("Password", hdnEncpass.Value.Trim());
                    Session["hdnEncpass"] = hdnEncpass.Value.Trim();
                    Response.Cookies["myScrlCookie"].HttpOnly = false;
                }
                //myScrlCookie.Values.Add("Password", objregistration.Password.ToString());
            }
            else
            {
                lblMessage.Text          = "Old password is incorrect.";
                lblMessage.CssClass      = "RedErrormsg";
                lnkResetPassword.Enabled = true;
                return;
            }
        }
        else
        {
            lblMessage.Text          = "Old password is incorrect.";
            lblMessage.CssClass      = "RedErrormsg";
            lnkResetPassword.Enabled = true;
            return;
        }
    }
    protected void lnkResetPassword_Click(object sender, EventArgs e)
    {
        CryptoGraphy objEncrypt = new CryptoGraphy();

        lnkResetPassword.Enabled   = false;
        objLogin.intRegistartionID = Convert.ToInt32(ViewState["UserID"]);
        dt = objLoginDB.GetDataTable(objLogin, DA_Login.Login_1.UserDetails);
        if (dt.Rows.Count > 0)
        {
            string oldPass = objEncrypt.Decrypt(Convert.ToString(dt.Rows[0]["vchrPassword"]));
            if (txtOldPassword.Text.Trim() == Convert.ToString(objEncrypt.Decrypt(Convert.ToString(dt.Rows[0]["vchrPassword"]))))
            {
                objregistration.RegistrationId = Convert.ToInt32(ViewState["UserID"]);
                objregistration.Password       = objEncrypt.Encrypt(txtNewPassword.Text.Trim());
                objLoginDB.AddEditDel_RegistrationDetails(objregistration, DA_Login.Login_1.SelectForUser);

                objLoginDB.AddAndGetLoginDetails(objLogin, DA_SKORKEL.DA_Login.Login_1.ChangePassword);

                lblMessage.Text          = "Password updated successfully.";
                lblMessage.CssClass      = "GreenErrormsg";
                lnkResetPassword.Enabled = true;
            }
            else
            {
                lblMessage.Text          = "Old password is incorrect.";
                lblMessage.CssClass      = "RedErrormsg";
                lnkResetPassword.Enabled = true;
                return;
            }
        }
        else
        {
            lblMessage.Text          = "Old password is incorrect.";
            lblMessage.CssClass      = "RedErrormsg";
            lnkResetPassword.Enabled = true;
            return;
        }
    }