private void CheckAllHOD() { try { String response = String.Empty; MailSetupManager manager = new MailSetupManager(); CustomList<MailSetup> EmailList = (CustomList<MailSetup>)HttpContext.Current.Session["MailSetup_MailSetupList"]; CustomList<MailSetup> HODList = manager.GetAllHOD(); String isHOD = HttpContext.Current.Request.QueryString["IsHOD"]; EmailList.ForEach(s => s.IsChecked = false); if (isHOD == "true") { foreach (MailSetup mS in EmailList) { MailSetup objMailSetup = HODList.Find(f => f.EmpKey == mS.EmpKey); if (mS.EmailAddress.Trim().IsNotNullOrEmpty() && objMailSetup.IsNotNull()) { mS.IsChecked = true; } } } HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(response); HttpContext.Current.Response.Flush(); } catch (Exception ex) { throw (ex); } }