<script language="javascript">
function RunBack()
{
window.opener.location='CancelMater.aspx';
window.opener.focus();
window.focus();
}
</script>
this.RegisterStartupScript("home","<script>RunBack();</script>"); //注册客户端代码
if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem || e.Item.ItemType==ListItemType.EditItem)
{
TableCell myTableCell;
//定义对“删除”单元格的引用
myTableCell = e.Item.Cells[6];
//定义对“删除”单元格中控件的引用
LinkButton btnDel = (LinkButton)myTableCell.Controls[0];
//添加当单击时弹出确认对话框的自定义属性
btnDel.Attributes.Add("onclick", "return confirm('您真的要删除此行吗?');");
}