private void loadGridView() { DocGiaBLL docGiaBLL = new DocGiaBLL(); List <DocGia> dsDocGia = docGiaBLL.dsDocGia(); gvDocGia_a.DataSource = dsDocGia; foreach (DocGia docGia in dsDocGia) { docGia.Anh = ResolveUrl(srcImage + docGia.Anh); } DataBind(); }
protected void btnTimKiem_Click(object sender, EventArgs e) { lblTK.Text = ""; string ten = txtTimKiem.Text; if (ten.Length > 0) { DocGiaBLL docGiaBLL = new DocGiaBLL(); List <DocGia> dsDocGia = docGiaBLL.dsDocGia("%" + ten.Trim() + "%"); lblTK.Text = "Kết quả tìm kiếm: " + dsDocGia.Count; gvDocGia_a.DataSource = dsDocGia; foreach (DocGia docGia in dsDocGia) { docGia.Anh = ResolveUrl(srcImage + docGia.Anh); } DataBind(); } else { loadGridView(); } }