![](/img/trans.png)
[英]Deleting a selected item from a listview in xamarin (using a SQLite DB)
[英]Double confirmation for deleting ITEM from DB?
我想从DB .hard delete中删除按钮单击的大量记录。我的要求是在删除之前提示用户两次。 1.是否要删除?? 通过确认框,我已经完成了。2.从按钮的cs页面中单击,例如“您确定要删除500个项目”
<asp:Button ID="btnReviewAll" Visible="false" runat="server" Text="Review All"
CssClass="button" ToolTip="Click to Review All" OnClick="btnReviewAll_Click" OnClientClick="javascript:return confirm('Are you sure want to Review all Closed Items??');" />
在按钮中单击.cs页面,我正在获取记录数..如何提示用户继续并显示在任何确认框中。
protected void btnReviewAll_Click(object sender, EventArgs e)
{
try
{
List<Items> lstWorkItems = objBPC.GetCurrentWorkItems();
//what to write here
}
catch (System.Exception ex)
{
Utils.DisplayMasterError(this.Page.Master, ex);
}
尝试使用javascript函数
<asp:Button ID="btnReviewAll"
Visible="false"
runat="server"
Text="Review All"
CssClass="button"
ToolTip="Click to Review All"
OnClick="btnReviewAll_Click"
OnClientClick="javascript:confirmation();" />
<script>
function confirmation() {
var yes = confirm("Are you sure want to delete that");
if (yes) {
var confirmyes = confirm("do you want to confirm delte");
if (confirmyes) {
return true;
}
}
return false;
}
</script>
尝试进行双重确认时发现了这一点。 Rafee发布的代码似乎无效。 W3C声明The confirm() method returns true if the user clicked "OK", and false otherwise.
所以这是我用的
$('.disableConfirm').on('click', function(){
if ( confirm('Confirm 1') ) {
if ( confirm('Confirm 2') ){
return true;
}
}
return false;
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.