带母版页的ASP页面上的jQuery
您好,我想知道在删除gridview中的一行之前如何实现confim消息,但不回发到服务器。我知道我需要使用jQuery,但我不知道如何使用。(我在gridview中选中一个复选框,然后按delete按钮删除,如果没有行被选中,我想显示一条警报消息) 这是我的aspx页面: 这是c代码:带母版页的ASP页面上的jQuery,jquery,asp.net,Jquery,Asp.net,您好,我想知道在删除gridview中的一行之前如何实现confim消息,但不回发到服务器。我知道我需要使用jQuery,但我不知道如何使用。(我在gridview中选中一个复选框,然后按delete按钮删除,如果没有行被选中,我想显示一条警报消息) 这是我的aspx页面: 这是c代码: 您可以从这里使用jQuery的对话框功能: 您的代码可能如下所示: $('#deletebuttonid').Click((function() { $( "#dialog-confirm" ).dialog
您可以从这里使用jQuery的对话框功能: 您的代码可能如下所示:
$('#deletebuttonid').Click((function() {
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
"Delete all items": function() {
// Call your asp.net delete function here
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
});
);
然后在你体内:
<div id="dialog-confirm" title="Empty the recycle bin?">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"> </span>These items will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
这些项目将被永久删除,无法恢复。你确定吗
请在此处发布相关的呈现HTML。