protected void btnSearch_Click(object sender, EventArgs e) { List <ATTEmployeeDeputaion> lst; this.lblSearch.Text = ""; if (this.txtSymbolNo.Text.Trim() == "" && this.txtFName.Text.Trim() == "" && this.txtMName.Text.Trim() == "" && this.txtSurName.Text.Trim() == "" && this.ddlGender.SelectedIndex == 0 && this.txtDOB.Text.Trim() == "" && this.ddlOrganization.SelectedIndex == 0) { this.lblStatusMessage.Text = "All Fields Cannot Be Empty."; this.programmaticModalPopup.Show(); } else { try { //lst = BLLEmployeeSearch.SearchEmployee(GetFilter()); Session["EmpSearchResult"] = BLLEmployeeDeputation.SearchEmployeeDeputation(GetFilter(), GetSearchType()); lst = (List <ATTEmployeeDeputaion>)Session["EmpSearchResult"]; this.lblSearch.Text = lst.Count.ToString() + " records found."; this.grdEmployee.DataSource = lst; this.grdEmployee.DataBind(); grdDiv.Visible = true; } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } } }