当前位置:编程学习 > C#/ASP.NET >>

asp.net删除确认提示框

asp教程.net删除确认提示框

protected void gv_rowdatabound(object sender, gridviewroweventargs e)
  {
  if (e.row.rowtype == datacontrolrowtype.datarow)
  {
  linkbutton lb = e.row.findcontrol("lnkbtndelete") as linkbutton;
  lb.attributes.add("onclick", "return confirm('确定要删除吗?')");
  }
  }


//方法二

<asp:button onclientclick="retrun confirm('确定要删除吗?')"></asp:button>

//方法三

用后台代码:btn.attributes.add("onclick","网页特效:return confirm('确定删除吗')")

者前台代码 onclientclick="return confirm('删除')";

//方法四

在那个删除按钮上添加: onclientclick="javascript:return confirm('是否删除??')",name="delete"
protected void gridview_rowdeleting(object sender, gridviewdeleteeventargs e)
  {
if(e.commandname=="delete"
{

执行删除语句!!!
}


 }

补充:asp.net教程,.Net开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,