我在父页面使用window.showModalDialog()打开一个对话框,这是父页面,点击“选择”按钮打开对话框:这是对话框:对话框中有一个<button id="Button1" onclick="closed()">关闭</button>按钮,
function closed() {
window.opener = null;
window.close();
}
点击后正常应该是关闭对话框。
我为什么我点击后的结果却是对话框关闭了,但是却打开了一个新的页面中再次打开了该对话框???
如下图:
实在是搞不明白,请各位大侠指点!!!!以下是对话框页面的页面代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="baseDataValuesetDialog.aspx.cs" Inherits="baseDataValuesetDialog" %><!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>
<LINK href="Images/index/YHChannelApply.files/Style.css" type=text/css rel=stylesheet />
<LINK href="Images/index/YHChannelApply.files/Manage.css" type=text/css rel=stylesheet />
<style type="text/css">
.tdclass
{
text-align:right;
}
.manageHead1 {
BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; COLOR: #000000; BORDER-BOTTOM: #cccccc 1px solid;
}
</style>
</head>
<script type="text/javascript">
function closed() {
window.opener = null;
window.close();
}
</script>
<body>
<form id="form1" runat="server">
<div>
<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15><IMG src="Images/index/YHChannelApply.files/new_019.jpg" border=0 /></TD>
<TD width="100%" background=Images/index/YHChannelApply.files/new_020.jpg height=20></TD>
<TD width=15><IMG src="Images/index/YHChannelApply.files/new_021.jpg" border=0 /></TD>
</TR>
</TBODY>
</TABLE> <TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15 background=Images/index/YHChannelApply.files/new_022.jpg>
<IMG src="Images/index/YHChannelApply.files/new_022.jpg" border=0 />
</TD>
<TD vAlign=top width="100%" bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
<TR>
<TD class=manageHead>当前位置: <asp:Label ID="lb_url" runat="server"></asp:Label></TD>
</TR>
<TR>
<TD height=2>
</TD>
</TR>
</TABLE>
<TABLE borderColor=#cccccc cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
<TBODY>
<tr>
<TD class=manageHead1>
<TABLE width="100%" border=0>
<tr>
<td class=manageHead1>
<asp:TreeView ID="TreeView1" runat="server"></asp:TreeView>
</td>
</tr>
<TR>
<TD align=right style="height: 25px">
<asp:Button ID="checked" runat="server" Text="确定" OnClick="checkedNode" />
<button id="Button1" onclick="closed()">关闭</button>
</TD>
</TR>
</TABLE>
</TD>
</tr>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</td>
<TD width=15 background=Images/index/YHChannelApply.files/new_023.jpg>
<IMG src="Images/index/YHChannelApply.files/new_023.jpg" border=0 />
</TD>
</tr>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15 style="height: 15px"><IMG src="Images/index/YHChannelApply.files/new_024.jpg" border=0 /></TD>
<TD align="center" width="100%" background=Images/index/YHChannelApply.files/new_025.jpg style="height: 15px"></TD>
<TD width=15 style="height: 15px"><IMG src="Images/index/YHChannelApply.files/new_026.jpg" border=0 /></TD>
</TR>
</TBODY>
</TABLE>
</div>
</form>
</body>
</html>
function closed() {
window.opener = null;
window.close();
}
点击后正常应该是关闭对话框。
我为什么我点击后的结果却是对话框关闭了,但是却打开了一个新的页面中再次打开了该对话框???
如下图:
实在是搞不明白,请各位大侠指点!!!!以下是对话框页面的页面代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="baseDataValuesetDialog.aspx.cs" Inherits="baseDataValuesetDialog" %><!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>
<LINK href="Images/index/YHChannelApply.files/Style.css" type=text/css rel=stylesheet />
<LINK href="Images/index/YHChannelApply.files/Manage.css" type=text/css rel=stylesheet />
<style type="text/css">
.tdclass
{
text-align:right;
}
.manageHead1 {
BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; COLOR: #000000; BORDER-BOTTOM: #cccccc 1px solid;
}
</style>
</head>
<script type="text/javascript">
function closed() {
window.opener = null;
window.close();
}
</script>
<body>
<form id="form1" runat="server">
<div>
<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15><IMG src="Images/index/YHChannelApply.files/new_019.jpg" border=0 /></TD>
<TD width="100%" background=Images/index/YHChannelApply.files/new_020.jpg height=20></TD>
<TD width=15><IMG src="Images/index/YHChannelApply.files/new_021.jpg" border=0 /></TD>
</TR>
</TBODY>
</TABLE> <TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15 background=Images/index/YHChannelApply.files/new_022.jpg>
<IMG src="Images/index/YHChannelApply.files/new_022.jpg" border=0 />
</TD>
<TD vAlign=top width="100%" bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
<TR>
<TD class=manageHead>当前位置: <asp:Label ID="lb_url" runat="server"></asp:Label></TD>
</TR>
<TR>
<TD height=2>
</TD>
</TR>
</TABLE>
<TABLE borderColor=#cccccc cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
<TBODY>
<tr>
<TD class=manageHead1>
<TABLE width="100%" border=0>
<tr>
<td class=manageHead1>
<asp:TreeView ID="TreeView1" runat="server"></asp:TreeView>
</td>
</tr>
<TR>
<TD align=right style="height: 25px">
<asp:Button ID="checked" runat="server" Text="确定" OnClick="checkedNode" />
<button id="Button1" onclick="closed()">关闭</button>
</TD>
</TR>
</TABLE>
</TD>
</tr>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</td>
<TD width=15 background=Images/index/YHChannelApply.files/new_023.jpg>
<IMG src="Images/index/YHChannelApply.files/new_023.jpg" border=0 />
</TD>
</tr>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD width=15 style="height: 15px"><IMG src="Images/index/YHChannelApply.files/new_024.jpg" border=0 /></TD>
<TD align="center" width="100%" background=Images/index/YHChannelApply.files/new_025.jpg style="height: 15px"></TD>
<TD width=15 style="height: 15px"><IMG src="Images/index/YHChannelApply.files/new_026.jpg" border=0 /></TD>
</TR>
</TBODY>
</TABLE>
</div>
</form>
</body>
</html>
解决方案 »
- 如何把一个字符串中所有字符用星号替代?
- JQuery 取了一个不存在的ID,返回值是什么?
- 求东软c .net面试题
- 各位大哥,谁有小尺寸(200*150)的FLASH+XML轮换效果啊?(100分)
- CuteEditor存入Access数据库的问题。急急
- 关于富文本发布页面制作的问题
- (求助!!)iis服务器配置问题
- 再问将datagrid里的数据导出到excel的问题!!!
- 在Aspx页面中怎样访问内部网络中文件服务器上的文件?好像提示用户名密码错误,怎样才能建立信任关系?
- 请教问题
- 关于自定义的sitemapDatasource取CurrentNode的问题
- 怎么获取image控件的图片?例如:textbox.text获取的是文本框的值,那怎么获取image控件的“值”呢?
function onsubmit() // 强制本窗口提交
{
document.getElementById("form1").target = "_self";
}
添加这个方法后,就行了。
比其他的什么iframe,frame啊好多了。
<base target="_self" />例如:
<head>
<base target="_self" />
</head>这个绝对可以,亲测。