20分,求救一窗口关闭问题.马上结帐.

yfhfh 2004-08-27 10:35:23
Response.Write("<script>window.open('index.aspx','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=270,left=300,top=200,screenX=300,screenY=200’');window.opener=null;window.close()</script>");

用http://localhost/zhuce/index.aspx 时候,上面的语句正常运行,
用http://192.168.0.100/zhuce/index.aspx 时候,index.aspx打开一下,马上关闭了,是什么原因?
注:192.168.0.100是本机IP
...全文
141 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
MyXQ 2004-08-27
  • 打赏
  • 举报
回复
gz
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
各位帮忙解决啊
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
我分开写了,还是:
用http://localhost/zhuce/index.aspx,效果可以实现,
用http://192.168.0.100/zhuce/index.aspx ,2个都关了,
我想可能是http://localhost/zhuce/index.aspx与http://192.168.0.100/zhuce/index.aspx有什么不同吧?
李天平 2004-08-27
  • 打赏
  • 举报
回复
Response.Write("<script>window.open('index.aspx','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=270,left=300,top=200,screenX=300,screenY=200’');window.opener=null;window.close()</script>");

你把这个分成两个Response.Write()执行,一个开,一个关
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
关键是父子窗体是同一个(index.aspx),只是一个大,一个小.
在子窗体中关闭父窗体,怎么实现啊
wangrenda 2004-08-27
  • 打赏
  • 举报
回复
你在子窗体中关闭父窗体,就可以了
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
我的意思是http://192.168.0.100/zhuce/index.aspx ,弹出一个小的登陆框,大的那个父窗体index.aspx关,小的那个index.aspx开着.
用http://localhost/zhuce/index.aspx,效果可以实现,
用http://192.168.0.100/zhuce/index.aspx ,2个都关了,是什么回事?
bomb_boy 2004-08-27
  • 打赏
  • 举报
回复
不知道你要什么样的效果
Response.Write("<script>window.open('index.aspx','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=270,left=300,top=200,screenX=300,screenY=200’');</script>");
的意思是开一个新窗口


后面window.close();是关闭窗口的意思
一起是先开再关,
如果只想开就用Response.Write("<script>window.open('index.aspx','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=270,left=300,top=200,screenX=300,screenY=200’');</script>");


想关就window.close();
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
自己先顶
yfhfh 2004-08-27
  • 打赏
  • 举报
回复
晕,那我用ip.localhost就有问题是什么原因?
fenglinzh 2004-08-27
  • 打赏
  • 举报
回复
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script>window.open('index.aspx','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=420,height=270,left=300,top=200,screenX=300,screenY=200’');window.opener=null;window.close()</script>");
}

我test没有问题啊, localhost, computername, IP, 都试了, 没有问题啊.

62,047

社区成员

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

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

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

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