Asp.net mvc 3 jQueryUI对话框没有';我不能用按钮
我试图在MVC3应用程序的列表操作中显示关于删除链接的模式确认对话框Asp.net mvc 3 jQueryUI对话框没有';我不能用按钮,asp.net-mvc-3,jquery-ui,modal-dialog,confirmation,Asp.net Mvc 3,Jquery Ui,Modal Dialog,Confirmation,我试图在MVC3应用程序的列表操作中显示关于删除链接的模式确认对话框 <script language="javascript" type="text/javascript"> $(document).ready(function () { $("#dialog-confirm").dialog({ autoOpen: false, modal: true, resizable: false, height:
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#dialog-confirm").dialog({
autoOpen: false,
modal: true,
resizable: false,
height: 180
});
});
$(document).delegate(".deleteLink", "click", function (e) {
e.preventDefault();
alert('test');
var $link = $(this);
var $dialog = $('#dialog-confirm')
.dialog({
autoOpen: false,
modal: true,
resizable: false,
height: 180,
buttons: {
'button text': function () {
alert("button"); //this is the button, do something with it :)
}
}
});
$dialog.dialog('open');
});
当我删除按钮选项时,它会工作,但当我添加它时,它不再显示
我哪里做错了?快速一看,按钮似乎是一个数组。尝试粘贴文档中的示例:
... {
autoOpen: false,
modal: true,
resizable: false,
height: 180,
buttons: [ { text: "Ok", click: function() { $( this ).dialog( "close" ); } } ]
}
起初我使用了.live选项,但它是相同的,我正在尝试使用相同的选项。那对你有用吗?求你了,我需要帮助。
@Html.ActionLink("حذف", "Delete", "Need", new { id = item.NeedID }, new { @class = "deleteLink", title = "حذف" })
... {
autoOpen: false,
modal: true,
resizable: false,
height: 180,
buttons: [ { text: "Ok", click: function() { $( this ).dialog( "close" ); } } ]
}