使用JavaScript全选后的删除方法
2011-07-14 21:50
471 查看
myArrayList1 = new ArrayList();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox myCheckBox = GridView1.Rows[i].Cells[0].FindControl("gvChkBox") as CheckBox;
if (myCheckBox != null && myCheckBox.Checked == true)
{
myArrayList1.Add("DELETE from TABLE where TiaoJian=" + GridView1.Rows[i].Cells[1].Text.ToString());
int Fhz = 0;
if (types == "1")
{
Fhz = myBusinessOperation.bGetInt(myArrayList1);
}
else
{
Fhz = myBusinessOperation.Oracle_GetInt(myArrayList1);
}
if (Fhz > 0)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert1", "<script>alert('删除成功!');</script>
4000
;");
}
}
}
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox myCheckBox = GridView1.Rows[i].Cells[0].FindControl("gvChkBox") as CheckBox;
if (myCheckBox != null && myCheckBox.Checked == true)
{
myArrayList1.Add("DELETE from TABLE where TiaoJian=" + GridView1.Rows[i].Cells[1].Text.ToString());
int Fhz = 0;
if (types == "1")
{
Fhz = myBusinessOperation.bGetInt(myArrayList1);
}
else
{
Fhz = myBusinessOperation.Oracle_GetInt(myArrayList1);
}
if (Fhz > 0)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert1", "<script>alert('删除成功!');</script>
4000
;");
}
}
}
相关文章推荐
- 使用JavaScript操作DOM节点元素的常用方法(创建/删除/替换/复制等)
- javascript中使用正则表达式删除前后空格的方法
- 使用JavaScript实现单击复选框实现全选与全不选功能并通过ajax实现批量删除功能
- javascript实现可全选、反选及删除表格的方法
- javascript中使用正则表达式删除前后空格的方法
- javascript实现可全选、反选及删除表格的方法
- javascript中使用splice方法轻松实现对数组元素的插入、删除、替换
- PHP 使用递归方法删除目录及目录下文件
- JavaScript关于attachEvent和addEventListener的使用方法
- JavaScript中的parse()方法使用简介
- Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法--使用rlwrap
- 在javascript中使用(读取、设置)Asp.net服务器的属性、方法和事件
- javascript按位非运算符的使用方法
- JavaScript中的bold()方法使用详解
- javascript数组元素的添加、删除与插入以及参数数组的使用
- javascript删除option选项的多种方法总结
- 使用Javascript获取图片坐标以及宽度高度的方法
- 在JavaScript中处理字符串之link()方法的使用
- javascript中的document.open()方法使用介绍
- JavaScript从数组中删除指定值元素的方法