像淘宝网上的产品比较,
选中几个产品后,按“比较”按钮,就显示这几个产品的一些相关参数比较。
------------------
我的问题是:
for(int i=0 ; i < DataGrid1.Items.Count ; i++)
{
CheckBox xxx = (CheckBox)DataGrid1.Items[i].FindControl("CheckBox1");
if(xxx.Checked)
{
Label1.Text += DataGrid1.Items[i].Cells[0].Text+ ",";
}
}
Response.Write("<script>window.open('WebForm2.aspx?cp_id=" + Label1.Text + "')</script>");
===========================================
在WebForm2.aspxstring[] bbb = Request.QueryString["cp_id"].Split(',');
foreach (string s in bbb)
{
if (s.Trim() != "")
{
for (int i = 0; i < bbb.Length; i++)
{
sql ="cp_id='"+s+"'";
}
}
}
SqlConnection MyConnection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["connectionString"]);
string strSel1 = "select * from chanpin where "+sql;
DataSet MyDataSet = new DataSet();
SqlDataAdapter myCommand = new SqlDataAdapter(strSel1,MyConnection);
myCommand.Fill(MyDataSet,"999");
this.DataGrid1.DataSource = MyDataSet;
this.DataGrid1.DataBind();
======================================
sql ="cp_id='"+s+"'"; 这句该怎么改啊?
或者还有其他办法没有啊?