我正在使用下面的代码来获取 Jquery UI 弹出窗口,但它没有返回值并且弹出框正在关闭
当我单击按钮时,我需要它必须作为确认框..!
代码 :
<style type="text/css" >
.ui-widget-header, .ui-widget-content
{ color: red !important;}
</style>
<script type="text/javascript">
$(document).ready(function () {
var $myDialog = $('<div></div>')
.html('You are going to Lock the Record.<br/>Click OK to confirm. Click Cancel to stop this action.')
.dialog({
autoOpen: false,
title: 'Confirm..?',
buttons: { "OK": function () {
$(this).dialog("close");
}, "Cancel": function () {
$(this).dialog("close");
}
}
});
$(function fn() {
$('#Button1').click(function (e) {
return $myDialog.dialog('open');
});
});
});
</script>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return fn() onclick="Button1_Click"/>