protected void btnSearchCallDetails_Click(object sender, EventArgs e) { if (txtEmpName.Text == "" && txtEmpNo.Text != "") { dt = objTelePhone.GetTelePhoneDetailsByEmpNo(txtEmpNo.Text); gdTelephoneDetails.DataSource = dt; gdTelephoneDetails.DataBind(); } else if (txtEmpNo.Text == "" && txtEmpName.Text != "") { dt = objTelePhone.GetTelePhoneDetailsByEmpName(txtEmpName.Text); gdTelephoneDetails.DataSource = dt; gdTelephoneDetails.DataBind(); } else { dt = objTelePhone.GetAllTelePhoneDetails(); gdTelephoneDetails.DataSource = dt; gdTelephoneDetails.DataBind(); } Session["TelephoneDtl"] = dt; txtEmpNo.Text = ""; txtEmpName.Text = ""; }