zoukankan      html  css  js  c++  java
  • 弹出窗口showModalDialog上提交按钮不打开新网页的补充

    showModalDialog弹出的网页,如果有提交按钮,则会打开一个新的IE窗口,无法正常关闭并返回到父

    窗口.
    网上很多文章都提到在弹出窗口的网页的<head>与</head>之间加入
    <base target="_self">可以解决这个问题
    确实这个办法在IE5.5以上是可行了,但是在IE5上仍然没有解决这个问题.
    而我的使用在很多在网吧上网,用的win98+IE5,以及win2k初始安装后自带的也是IE5
    看了SPS的权限管理时用户选择弹出网页,它在win98+ie5下却没有这个问题,所以我相信一定有其它

    的办法解决这个问题,在网上找了一下,最后采用frame过渡网页的方案解决了这个问题.

    btnuserselect.Attributes.Add ("onClick",ModalWindow("bmsuserlist.htm",550,460));

    public string ModalWindow(string openAspxPage,int width,int height)
      {     
       return string.Format("javascript:window.showModalDialog(\"{0}

    \",window,\"status:no;center:yes;help:no;resizable:yes;dialogWidth:{1}

    px;dialogHeight:{2}px\")",openAspxPage,width,height);   
      }

    bmsuserlist.htm
    <html>
      <head>
        <title>用户选择</title>   
      </head>
      <frameset rows="0,*">
                  <frame src="about:blank">
                  <frame src="seleuser.aspx">
           </frameset><noframes></noframes>
    </html>

    seleuser.aspx
    取消按钮
    btnno.Attributes.Add("OnClick", "window.parent.close();");
    从listbox列表选择值后按确定按钮,返回值并关闭.
    btnok.Attributes.Add("OnClick",

    "window.parent.dialogArguments.Form1.txtuser.value='"+lb1.SelectedValue

    +"|"+lb1.SelectedItem.Text +"';window.parent.close();");


    参考:
    http://dev.csdn.net/develop/article/15/15113.shtm

  • 相关阅读:
    网页 js 获取DPI pxTomm
    利用自定义属性实现js点击事件 委托
    鼠标移动div时禁止选中div中的文字的方法
    关于if简写语句优化的方法
    .clearfix::after(清除浮动)
    js 事件委托
    清空共享池
    oracle中scott用户权限不足
    安装完Oracle 12C数据库,scott账户过期,解锁方法
    Vulnhub靶场-Me Tomcat Host 学习笔记
  • 原文地址:https://www.cnblogs.com/zyk/p/72402.html
Copyright © 2011-2022 走看看