window.showmodaldialog() 产生的问题

快乐的毛毛虫 2008-03-25 03:38:47
window.showmodaldialog();

打开的窗口中,有一按钮,现在一点按钮,就弹出一个新页去执行代码,怎么样必免弹出新页呢?
...全文
157 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
快乐的毛毛虫 2008-03-28
  • 打赏
  • 举报
回复
是啊,我不粗口了,你倒是给我解决一下嘛。我这么多人帮助我,好歹我也得把贴子结了吧,要不你帮我结
Sandy945 给 90 分,其它的随便给吧
viena 2008-03-27
  • 打赏
  • 举报
回复
LS请不要粗口
ipqxiang 2008-03-26
  • 打赏
  • 举报
回复
在页面中加入这个就行了<base target="_self">
zhulei2008 2008-03-26
  • 打赏
  • 举报
回复
<base target="_self">
zyjmib 2008-03-26
  • 打赏
  • 举报
回复
lm
快乐的毛毛虫 2008-03-26
  • 打赏
  • 举报
回复
好的,谢谢.

不过,很无奈,还是用了一个中间页面,用iframe.src 链接的方式
快乐的毛毛虫 2008-03-26
  • 打赏
  • 举报
回复
怎么结不了贴子,自己的分是1,我这个结不了贴子的问题已经提出了100回了,***CSDN就是不解决
阿非 2008-03-25
  • 打赏
  • 举报
回复
改下 showModalDialog 的Owner 页

<input type="button" onclick="javascript:window.showModalDialog('HTMLPage.htm',window);" value='打开'/>

改下 要打开的页



<input type="button" onclick="javascript:window.location.href='showModalDialogReload.aspx';" value="跳转" />





然后要刷新的页 showModalDialogReload.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="showModalDialogReload.aspx.cs" Inherits="showModalDialogReload" %>

<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="javascript:window.dialogArguments.location = window.dialogArguments.location;" value="刷新" />
</div>
</form>
</body>
</html>


最好在刷新之后关闭本页 不关闭本页,不会刷新

<input type="button" onclick="javascript:window.dialogArguments.location = window.dialogArguments.location;self.close();" value="刷新" />

阿非 2008-03-25
  • 打赏
  • 举报
回复
showModalDialog 的Owner 页


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="showModalDialog.aspx.cs" Inherits="showModalDialog" %>

<!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>
</head>

<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="javascript:window.showModalDialog('HTMLPage.htm');" value='打开'/>
</div>
</form>
</body>
</html>



框架页



<html>

<frameset cols="*">
<frame src="newPage.aspx">

</frameset>

</html>



要打开的页

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="newPage.aspx.cs" Inherits="newPage" %>

<!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>

</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="javascript:window.location.href='button.aspx';" value="跳转" />

</div>
</form>
</body>
</html>

快乐的毛毛虫 2008-03-25
  • 打赏
  • 举报
回复
楼上的朋友们,有没有别的办法.
我现在 用的是 母版页
而母版面是别人做好的,不让改动
阿非 2008-03-25
  • 打赏
  • 举报
回复
1. 超链接 用 <base target="_self">

2.非超链接 用frameset/iframe
liusen5555 2008-03-25
  • 打赏
  • 举报
回复
window.location='url';
快乐的毛毛虫 2008-03-25
  • 打赏
  • 举报
回复
不要用新页面中转
阿非 2008-03-25
  • 打赏
  • 举报
回复

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧