可以用cheakbox实现........
ArrayList list = new ArrayList();
for(int i =0;i<this.DataGrid1.Items.Count;i++)
{
CheckBox ck = this.DataGrid1.Items[i].Cells[0].FindControl("CheckBox1") as CheckBox;
int newid = Convert.ToInt32(this.DataGrid1.Items[i].Cells[1].Text);
if(ck != null)
{
if(ck.Checked)
{
list.Add(newid);
}
}
}
if(list.Count != 0)
{
BLL.News news = new BLL.News();
news.DeleteMostNews(list);
Response.Write("<script>alert('删除成功!');</script>");
BindNews();
}
我这是段 C#代码