zoukankan      html  css  js  c++  java
  • Iframe之间及iframe与父窗体之间值的传递

    方法一:ScriptManager.RegisterClientScriptBlock(this,typeof(Page), "NoInformation", "window.parent.frames['Add'].location.reload();", true);    此:  会弹出页面刷新错误
     方法二: ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "NoInformation", "window.parent.frames['Add'].location.href='DepartAdd.aspx';", true);     最好的方法 可解决跳转刷新后窗体样式的改变。

     

     

    参考:

    (一)父窗体调用iframe子窗体的例子:
    1
    //将子iframe中text的值赋给父窗体中一个text
    document.getElementById('applyDate').value=window.frames["capitalList"].document.all('applytime').value;
    2
    //父窗体中的一个按钮onclick触发子iframe中form的button1服务器端事件
    window.frames(capitallist).document.forms.item(0).button1.click();或写作:
    window.frames(capitallist).document.form1.button1.click();


    (二)iframe子窗体调用父窗体的例子:
    1
    //子iframe中的form的button的onclick事件给父窗体的一个text赋值
    window.parent.document.all('applyDate').value=document.getElementById('applytime').value;
    2
    //子页面调用父窗体的某个按钮的按钮事件
    window.parent.form1.button1.click()
    (三)iframe子窗体之间相互调用
    //右边iframe中页面的按钮调用左边的iframe中的页面,让左边页面得以刷新
    parent.frame(menu).window.location.reload();
  • 相关阅读:
    github添加版本号
    centOS 7联网
    运用session来控制用户的异地登录被挤下线情况
    寻找节点d=n的节点算法
    基于Seajs的可控台球碰撞游戏
    RequireJs 源码解读及思考
    BackBone 源码解读及思考
    关于「远程兼职」
    cocos2d-html5 中的性能优化
    细说移动前端Android联调
  • 原文地址:https://www.cnblogs.com/hyd309/p/1283184.html
Copyright © 2011-2022 走看看