如何在用户删除任何记录时提示用户? [英] How to prompt the user when ever he delete any record?

查看:80
本文介绍了如何在用户删除任何记录时提示用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi开发人员,

我这里有问题,

每当我单击删除按钮时,都会出现一个消息框,它必须询问您确定要删除此记录吗?"

它应该有两个选项,是和否,如果我单击是",则应删除记录;如果我单击否",则不会删除记录.

如何在C#.net和使用C#的asp.net中做到这一点?
谢谢你,

最好的问候,

Thiru

hi developers,

here i have some problem,

when ever i click on the delete button,then one Message box should come, it must ask "Are You sure Do YOU want to delete this record?"

it should have two options YES and NO ,if i click YES the Record should be delete and if I click on NO ,the record will not be deleted.

how can i do this in C#.net and in asp.net using C#.?

Thank u,

Best Regards,

Thiru

推荐答案

Google ASP.NET + confirm + javascript[^]
You need to inject/associate javascript to the button/control event to ask a confirmation.

Thiru_G写道:
Thiru_G wrote:

两个选项是和否


为此,您将需要VBScript确认而不是Java脚本. Javascript提供,可以&取消作为选项,而VBScript将为您提供是&".否.


For this, you would need VBScript confirm instead of Javascript. Javascript gives, Ok & Cancel as options whereas VBScript will give you Yes & No.


我应该完整阅读问题.




在按钮控件上,添加以下javascript代码:
onclick ="return ConfirmDelete();"


Hi,

on the button control, add the following javascript code:
onclick="return ConfirmDelete();"


<script language="javascript">
function ConfirmDelete()
{
if(confirm("Are you sure you want to delete this record?"))
{
  return true;
}
return false;
}
</script>


这篇关于如何在用户删除任何记录时提示用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆