Code
<script language="javascript">
function ImgDeleteClick(id){
if(window.confirm("您确认要删除吗?"))
{
document.getElementById("hdDel").value=id;
document.forms[0].submit();
}
}
</script>
<asp:TemplateColumn>
<ItemTemplate>
<img src="images/delete.gif" onclick="ImgDeleteClick('<%# Eval("Record_ID") %>')" />
</ItemTemplate>
</asp:TemplateColumn>
<input type=hidden id="hdDel" value="" runat=server />
if (!string.IsNullOrEmpty(hdDel.Value))
{
//Delete(hdDel.Value);
IMPEntry ie = new IMPEntry();
ie.ConnectString = Application["Conn"].ToString();
ie.DeleteComponent(int.Parse(hdDel.Value));
hdDel.Value ="";
Response.Write("<script>alert('删除成功!');window.location.href='"+this.Request.RawUrl+"'</script>");
}
<script language="javascript">
function ImgDeleteClick(id){
if(window.confirm("您确认要删除吗?"))
{
document.getElementById("hdDel").value=id;
document.forms[0].submit();
}
}
</script>
<asp:TemplateColumn>
<ItemTemplate>
<img src="images/delete.gif" onclick="ImgDeleteClick('<%# Eval("Record_ID") %>')" />
</ItemTemplate>
</asp:TemplateColumn>
<input type=hidden id="hdDel" value="" runat=server />
if (!string.IsNullOrEmpty(hdDel.Value))
{
//Delete(hdDel.Value);
IMPEntry ie = new IMPEntry();
ie.ConnectString = Application["Conn"].ToString();
ie.DeleteComponent(int.Parse(hdDel.Value));
hdDel.Value ="";
Response.Write("<script>alert('删除成功!');window.location.href='"+this.Request.RawUrl+"'</script>");
}