zoukankan      html  css  js  c++  java
  • asp.net父窗口、子窗口


    一:转向子窗口的几种方法

    1.在数据控件中(如:GridView,Repeater)

    1
    <a  href="#" onclick="window.open('money.aspx?lowhouseid=<%# DataBinder.Eval(Container.DataItem, "lowhouseid") %>&difficultid=<%# DataBinder.Eval(Container.DataItem, "difficultid") %>','','width=600,height=400,left=350,top=400,scrollbars=0,staus=0,toolbar=0,location=0');">
    <%# DataBinder.Eval(Container.DataItem, "money")%> </a>
    2
    <a  href="#" onclick="var obj = new Object();obj.name='51js';window.showModalDialog('area.aspx?lowhouseid=<%# DataBinder.Eval(Container.DataItem, "lowhouseid") %>&difficultid=<%# DataBinder.Eval(Container.DataItem, "difficultid") %>',obj,'dialogWidth=650px;dialogHeight=400px;scroll:no');">
    <%# DataBinder.Eval(Container.DataItem, "area")%> </a>

    2:在js代码中

    3
      <script language="javascript">
    function fjzl() {
    window.open('HouseMap.aspx?house_id=<%=houseid() %>&buildingnum=<%=buildingnum() %>', '', 'width=1000,height=800,left=100,top=100,scrollbars=1,staus=1,toolbar=1,location=1');
    }
    </script>

    3:在后台中

    4
    Response.Redirect("http://www.cnblogs.com/../Error.html");

    二:关闭子窗口刷新父窗口

    1.html中(注:若父窗口中不用window.open打开子窗口,则window.opener会报错)

    1
    <body MS_POSITIONING= "GridLayout "   language="javascript"   onunload= "return   window_onunload() "> 
    </body>


    <script language="javascript">
    function window_onunload() {
    window.opener.location.reload()
    }
    </script>

    2.后台中

    2
    ScriptManager.RegisterStartupScript(this, typeof(string), "key", "window.close();window.opener.window.location.reload(true); ", true);









  • 相关阅读:
    分享一个详情页
    ES6初探,变量的声明
    ES6初探,什么是ES6
    提问回顾
    个人阅读&个人总结
    结对项目-数独程序扩展
    个人作业Week3-案例分析
    个人作业Week2-代码复审
    个人作业1
    【个人项目】数独
  • 原文地址:https://www.cnblogs.com/MyBeN/p/2342368.html
Copyright © 2011-2022 走看看