![](/img/trans.png)
[英]How to Make show Save As Dialog box in asp.net web Application using Button click
[英]How to make dialog box in ASP.Net using Jquery?
我正在尝试使用模型创建一个对话框。 但是我没有得到输出。 这是我的代码
头文件
<head id="Head1" runat="server">
<title></title>
<link href="css/jquery-ui.css" rel="stylesheet" />
<script src="js/jquery-3.1.1.js"></script>
<script src="js/jquery-ui.js"></script>
<%--<script src="js/jquery-ui.min.js"></script>--%>
<script src="js/Report-Filter.js"></script>
<script src="js/ReportTotalSalesPivot.js"></script>
<script src="js/bootstrap.js"></script>
<link href="css/bootstrap.css" rel="stylesheet" />
<link href="css/jquery-ui.min.css" rel="stylesheet" />
<link href="css/Accordian-Hide-Show.css" rel="stylesheet" />
<script src="js/Accordian-Hide-Show.js"></script>
<link href="css/ReportTotalSalesPivot-style.css" rel="stylesheet" />
</head>
内部身体
<input id="btnSave opener" class="btn btn-info" type="button" value="SAVE" />
<div id="wrapper">
<p>Some txt goes here</p>
</div>
jQuery代码
$(document).ready(function () {
$('#wrapper').dialog({
autoOpen: false,
title: 'Basic Dialog'
});
$('#opener').click(function () {
$('#wrapper').dialog('open');
return false;
});
});
请不要建议这个小提琴 。 从这里我只有代码。 我认为在head标签中安排链接的问题。
我收到错误消息。 我认为该错误与该模型无关。
错误味精
jquery-3.1.1.js:6170 GET http:// localhost:55047 / css / images / ui-icons_444444_256x240.png 404(未找到)
将按钮id
更改为一个无空格的按钮。 您不能在ID内使用空格。 看起来您正在以与class
相同的方式使用它,您可以在其中添加多个值。
<input id="btnSave" class="btn btn-info" type="button" value="SAVE" />
然后,如果您修改jQuery侦听器,则模式将打开。
$('#btnSave').click(function () {
$('#wrapper').dialog('open');
});
那些您丢失的图像可以在这里下载 。 它们包含在UI下载中。
您需要按以下方式排列标题标签。 以下是工作代码。 头文件序列很重要。
<html>
<head>
<title>Bootstrap Modal PopUp</title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script src="js/bootstrap.js"></script>
<link href="css/bootstrap.css" rel="stylesheet" />
<link href="css/bootstrap-theme.css" rel="stylesheet" />
<script>
$(document).ready(function () {
$("#showmodal").click(function () {
$('#myModal').modal('show');
});
});
</script>
</head>
<body>
<button id="showmodal" class="btn btn-info btn-lg" type="button">Open Modal</button>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
This is the test modal pop-up.
</div>
<div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">Close</button></div>
</div>
</div>
</div>
</body>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.