0
我想下載被檢查的gridview記錄。 Gridview包含圖像以及數據。數據正在下載到Excel表格中。問題是當我檢查要下載的griview的記錄時。只有最後一次檢查的記錄被下載。所有沒有得到下載。我想我應該使用一個數組。但是幫助我做到這一點:所有沒有得到下載的記錄下載按鈕點擊
BubnaManager manager = new BubnaManager();
int count = GridAssigned.Rows.Count;
var data = (List<ProductImageMapWrapper>)null;
for (int i = 0; i < count; i++)
{
HiddenField ImageId = GridAssigned.Rows[i].FindControl("hdn_id2") as HiddenField;
int ImId = Convert.ToInt32(ImageId.Value);
CheckBox chkIDLabel = GridAssigned.Rows[i].FindControl("NewCheckBoxImage") as CheckBox;
if (chkIDLabel.Checked == true)
{
TextBox txtCompany = GridAssigned.Rows[i].FindControl("TextBoxCompany") as TextBox;
TextBox txtBrand = GridAssigned.Rows[i].FindControl("TextBoxBrand") as TextBox;
HiddenField hdBrand = GridAssigned.Rows[i].FindControl("newhdBrand") as HiddenField;
HiddenField hdCompany = GridAssigned.Rows[i].FindControl("newhdCompany") as HiddenField;
int brandid = bm.getIdbyBrand(txtBrand.Text);
int CompanyId = bm.getIdbyCompany(txtCompany.Text);
data = manager.GetSearchResultForAssignedProductImageMap1(ImId, CompanyId, brandid);
}
}
if(data.count!=0)
{
// code for downloading
}
但它給出了一個錯誤,當我這樣做你的方式 – Manu
你能告訴我們你得到什麼錯誤? – Nunners