if (((CheckBox)GridView1.Rows[i].Cells[0].Controls[1]).Checked)//第9行 if (bookcart.Contains (GridView1.Rows[i].Cells[1].Text))//第14行 Cells[0]//第9行 Cells[1]//第14行 不一样是不是会有影响
Label3.Text = "the Book" + booklist.Add(GridView1.Rows[i].Cells[1].Text) + "exsits in shopping cart"; 我很不理解这句的含义 booklist.Add()返回什么?你也加上去?既然加了。。那你的IF就没意义了因为ELSE也是这句代码 else { booklist.Add(GridView1.Rows[i].Cells[1].Text); }
{
Label3.Text += "the Book" + GridView1.Rows[i].Cells[1].Text + "exsits in shopping cart";
}
else
{
booklist.Add(GridView1.Rows[i].Cells[1].Text);
}
设置断点,单步
if (bookcart.Contains (GridView1.Rows[i].Cells[1].Text))//第14行
Cells[0]//第9行
Cells[1]//第14行
不一样是不是会有影响
我很不理解这句的含义 booklist.Add()返回什么?你也加上去?既然加了。。那你的IF就没意义了因为ELSE也是这句代码
else
{
booklist.Add(GridView1.Rows[i].Cells[1].Text);
}