jquery.modalbox.show 插件
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/bgiframe.js" type="text/javascript"></script>
<script src="source/modalbox.js" type="text/javascript"></script>
<link href="source/modalbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {
});
function showModal() {
$.modalbox.show({
modal: true,
// contentType: 'html', // html selector url
// content: "<h1>这是内容</h1>", // 依据 contentType 而定
contentType: 'selector', // html selector url
content: "#dialog", // 依据 contentType 而定
width: 600,
height: 400,
// contentType: "url",
// content: "Child.aspx"
showCancel: false,
showOk: true,
showTitle: true,
onok:doOK
// okBtnName: 'OK',
// cancelBtnName: 'Cancel',
// zIndex: 900,
// onclose: null, // function 关闭后执行
// onopen: null, // function, 只有返回true时才会显示窗口
// onok: null, // function 点击确定按钮后,窗口关闭前执行
// oncancel: null // function 点击取消按钮后,窗口关闭前执行
});
}
function doOK() {
document.getElementById('Button1').click();
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<input type="button" onclick="showModal();" value="弹 出" />
<center>
<h1>klsdjflksjdflskjdflk</h1>
</center>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="dialog" style="display:none">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" style="display:none" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
/Files/wucg/modalbox.zip
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="scripts/jquery.js" type="text/javascript"></script>
<script src="scripts/bgiframe.js" type="text/javascript"></script>
<script src="source/modalbox.js" type="text/javascript"></script>
<link href="source/modalbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {
});
function showModal() {
$.modalbox.show({
modal: true,
// contentType: 'html', // html selector url
// content: "<h1>这是内容</h1>", // 依据 contentType 而定
contentType: 'selector', // html selector url
content: "#dialog", // 依据 contentType 而定
width: 600,
height: 400,
// contentType: "url",
// content: "Child.aspx"
showCancel: false,
showOk: true,
showTitle: true,
onok:doOK
// okBtnName: 'OK',
// cancelBtnName: 'Cancel',
// zIndex: 900,
// onclose: null, // function 关闭后执行
// onopen: null, // function, 只有返回true时才会显示窗口
// onok: null, // function 点击确定按钮后,窗口关闭前执行
// oncancel: null // function 点击取消按钮后,窗口关闭前执行
});
}
function doOK() {
document.getElementById('Button1').click();
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<input type="button" onclick="showModal();" value="弹 出" />
<center>
<h1>klsdjflksjdflskjdflk</h1>
</center>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="dialog" style="display:none">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" style="display:none" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
/Files/wucg/modalbox.zip