在我的应用程序中有带有复选框的网格视图,选择多个复选框单击打印按钮在单独的窗口中打开 pdf。 我的代码是
for (int i = 0; i < grdAdditionalInsured.Rows.Count; i++)
{
CheckBox chk = (CheckBox)grdAdditionalInsured.Rows[i].Cells[0].FindControl("chkAdditionalInsured");
if (chk.Checked == true)
{
//**some code to get the id based on values**
string file = "/CertPrints/" + id.ToString() + ".pdf";
String js = @"WindowPopup('" + file + "');";
ScriptManager.RegisterStartupScript(this, this.GetType(), file, js, true);
}
}
以上代码仅显示最后记录的pdf文件,请给我建议。