1、弹出新页面,置顶
父页面:
Button:
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="openDia();return false;" />
JavaScript:
<script type="text/javascript">
function openDia() {
var returned = window.showModalDialog("UserList.aspx?" + (new Date()), window);
if (returned) {
document.getElementById("ret").innerHTML = returned;
}
else {
document.getElementById("ret").innerHTML = "";
}
}
</script>
子页面:
<asp:Button ID="Button1" runat="server" OnClientClick="getSelected();return false;" Text="Button" />
<script type="text/javascript"> |
function getSelected() { |
var data = []; |
ch = document.getElementsByName("t") |
for (i = 0; i < ch.length; i++) { |
if (ch[i].checked) { |
data.push(ch[i].value); |
} |
} |
window.returnValue = data.toString(); |
window.close(); |
} |
</script> |
2、弹出一个置顶的新页面,新页面关闭后刷新父页面
<
a
href
="javascript:showModalDialog('UserList.aspx');window.location.reload()"
>aaaaa
</
a
>
3、刷新父页面
window.location.reload()
4、
function update(obj) {
var ddl_sys = document.getElementById("ddl_system");
var sysValue = ddl_sys.options[ddl_sys.selectedIndex].value;
var ddl_modules = document.getElementById("ddl_modules");
var modulesValue = ddl_modules.options[ddl_modules.selectedIndex].value;
window.showModalDialog('PageAdd.aspx?isAdd=0&SystemID=' + sysValue + '&ModulesID=' + modulesValue + '&ID=' + obj, null, 'dialogHeight:600px;dialogWidth:650px;status:0;help:0 ');
}