protected void btnUpdatePwd_Click(object sender, EventArgs e) { try { string location = Session["LocationName"].ToString(); string EmpName = Session["EmpName"].ToString().Trim(); int userid = Convert.ToInt32(Session["UserID"]); string oldPwd = txtOldpwd.Text.Trim(); string NewPwd = txtNewPwd.Text.Trim(); Attendance.BAL.EmployeeBL obj = new EmployeeBL(); bool bnew = obj.UpdatePasswordByUserID(userid, oldPwd, NewPwd); if (bnew) { txtOldpwd.Text = ""; txtNewPwd.Text = ""; txtConfirmPwd.Text = ""; mdlChangePwd.Hide(); System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('Password changed successfully..');", true); } else { txtOldpwd.Text = ""; txtNewPwd.Text = ""; txtConfirmPwd.Text = ""; System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "alert('Invalid userid and password..');", true); txtOldpwd.Focus(); } } catch (Exception ex) { } }