第一個頁面Datagrid的button事件中加入
string strSql ="";
foreach(DataGridItem t in this.guid_daying.Items)
{
CheckBox TChBox_del=(CheckBox)t.FindControl("TChBox_del");
if(TChBox_del.Checked)
{
Label vLbl=new Label();
vLbl=(Label)(t.FindControl("lblID"));
if (strSql.Length==0)
{
strSql=vLbl.Text.ToString().Trim();
}
else
{
strSql=strSql+","+vLbl.Text.ToString().Trim();
}
}
}
if (strSql.Length==0)
{
con.Alert("請選擇!",Page);
//Session["printSql"]="select * from vwPrintIntroduceOrder where idno is null";
}
else
{
strSql =" where idno in ("+strSql+")";
Session["printSql"]="select * from vwPrintIntroduceOrder " +strSql;
第二個頁面加載中加入
string strSql = Session["printSql"].ToString();