如何点下button按钮 ,弹出个高度宽度 都900px的新窗口,而且这个窗口是一弹出就要刷新
用asp.net 开发web 打开新窗口并刷新
- 提问者网友:我一贱你就笑
- 2021-04-24 23:54
- 五星知识达人网友:我住北渡口
- 2021-04-25 00:38
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestWebDemo.WebForm1" %>
<!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>js</title>
<script> var subwindow = null;
function AutoRefreshPage() {
subwindow = window.open(' http://www.baidu.com', '打开百度', 'width=900,height=900,scrollbars=yes');
subwindow.location = ' http://www.baidu.com'; subwindow.location.reload();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:Button ID="Button1" runat="server" OnClientClick="AutoRefreshPage();" Text="Button" />
</form>
</body>
</html>
- 1楼网友:酒醒三更
- 2021-04-25 02:09
用JS脚本可以作到
function openDIV(id, url) { var scrX = document.body.clientWidth; var scrY = document.body.clientHeight; var tmp = document.createElement("div"); tmp.style.position="absolute"; tmp.style.top=0; tmp.style.left=0; tmp.style.width = scrX; tmp.style.height = scrY; var htm = "<iframe src='" + url + "'frameborder='0' scrolling='no'></iframe>"; tmp.setAttribute("innerHTML", htm); tmp.setAttribute("id", id); document.body.appendChild(tmp); }
- 2楼网友:零点过十分
- 2021-04-25 01:38
弹出的这个功能 不能用在带有选项卡的浏览器,(没有效果)
试着用模式窗口