在GridView中使用确认删除使用jQuery UI对话框时,单击取消按钮时也会记录删除。任何解决方案? [英] While Delete in GridView with Confirmation Using jQuery UI Dialog, when click on Cancel button also record become deleted.Any Solution?

查看:51
本文介绍了在GridView中使用确认删除使用jQuery UI对话框时,单击取消按钮时也会记录删除。任何解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用过这段代码:



$(文件).ready(function(){

$(。delete_button ).click(function(){

返回确认('你想删除吗?');

});

} );;



< asp:GridView ID =GridView1runat =serverAutoGenerateColumns =FalseOnRowDeleting =GridView1_RowDeleting>

< asp:CommandField ButtonType =ImageDeleteImageUrl =../ images / close.pngShowDeleteButton =TrueControlStyle-CssClass =。delete_button>


解决方案

(document).ready(function(){


( .delete_button)。点击(function(){

返回确认('你想删除吗?');

});

});



< asp:GridView ID =GridView1runat =serverAutoGenerateColumns =FalseOnRowDeleting =GridView1_RowDeleting>

< asp:CommandField ButtonType =ImageDeleteImageUrl =../ images / close.pngShowDeleteButton =TrueControlStyle-CssClass =。delete_button>



检查以下链接



ASP.NET GridView中的jQuery确认 [ ^ ]



使用jQuery UI对话框确认删除GridView中的功能 [ ^ ]



希望他们帮助你完成任务。

I've used this code:

$(document).ready(function () {
$(".delete_button").click(function () {
return confirm('Do you want to delete?');
});
});

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDeleting="GridView1_RowDeleting">
<asp:CommandField ButtonType="Image" DeleteImageUrl="../images/close.png" ShowDeleteButton="True" ControlStyle-CssClass=".delete_button">

解决方案

(document).ready(function () {


(".delete_button").click(function () {
return confirm('Do you want to delete?');
});
});

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDeleting="GridView1_RowDeleting">
<asp:CommandField ButtonType="Image" DeleteImageUrl="../images/close.png" ShowDeleteButton="True" ControlStyle-CssClass=".delete_button">


Check the links below

jQuery confirmation in ASP.NET GridView[^]

Delete Functionality in GridView with Confirmation Using jQuery UI Dialog[^]

Hope they help you achieve your task.


这篇关于在GridView中使用确认删除使用jQuery UI对话框时,单击取消按钮时也会记录删除。任何解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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