protected void btnResetPassword_Click(object sender, EventArgs e) { try { string password = txtResetNewPassword.Text.Trim(); string EmpID = lblEmpID.Text.Trim(); String strHostName = Request.UserHostAddress.ToString(); int userid = Convert.ToInt32(Session["UserID"]); string strIp = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString(); string timezone = ""; if (Convert.ToInt32(Session["TimeZoneID"]) == 2) { timezone = "Eastern Standard Time"; } else { timezone = "India Standard Time"; } DateTime ISTTime = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById(timezone)); var CurentDatetime = ISTTime; EmployeeBL obj = new EmployeeBL(); bool bnew = obj.ResetPassWordByAdmin(userid, strIp, password, CurentDatetime, EmpID); mdlResetPassword.Hide(); } catch (Exception ex) { } }