HTML:
<button type="button" class="btn btn-success" style="margin-bottom:14px" id="btnAdd" onclick="modaladdedit('URLToMyController')"><i class="fa fa-plus"> Add New</i></button>
头号标签:
<link rel="stylesheet" href="/Content/themes/base/jquery-ui.min.css" />
<script src="/Scripts/jquery-3.3.1.js"></script>
<script src="/Scripts/bootstrap.min.js"></script>
<link rel="stylesheet" href="/Content/bootstrap.min.css">
<link rel="stylesheet" href="/Content/font-awesome.min.css">
<link rel="stylesheet" href="/Content/ionicons.min.css">
<link rel="stylesheet" href="/admin-lte/css/AdminLTE.min.css">
<link rel="stylesheet" href="/admin-lte/css/skins/skin-black-light.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<link href="/Content/jquery.dataTables.min.css" rel="stylesheet"/>
<link href="/Content/datatablefooteredit.css" rel="stylesheet"/>
<script src="/Scripts/jquery-ui-1.12.1.min.js"></script>
<script src="/Scripts/jquery.dataTables.min.js"></script>
<script src="/Scripts/dataTables.bootstrap.min.js"></script>
后
</body>
:
<script src="/Scripts/jquery.slimscroll.min.js"></script>
<script src="/Scripts/fastclick.js"></script>
<script src="/admin-lte/js/adminlte.min.js"></script>
<script src="/admin-lte/js/demo.js"></script>
后脚本
</身体&
:
$(document).ready(function () {
$('.sidebar-menu').tree()
});
var Popup, table;
$(document).ready(function () {
// Some code here...
});
// Popup Modal Window
function modaladdedit(url){
var formDiv= $('</div>');
$.get(url)
.done(function(response){
formDiv.html(response);
Popup= formDiv.dialog({
autoOpen: true,
resizable: false,
position: 'center',
modal: true,
title: 'Add/Edit Email Data',
height: 500,
width: 600,
close: function (){
Popup.dialog('destroy').remove();
}
});
});
当我点击按钮时,对话框窗口不会弹出,控制台也不会出现任何错误。
我什么都试过了,什么都没用。我尝试更改CSS和JS文件的顺序,但没有真正起作用。
任何帮助都将不胜感激。
谢谢您!