我在a页面上用tipswindown插件,弹出一个iframe,在iframe上引用一个b页面,如何在这个b页面的Btn按钮点击时关闭这个弹出的iframe同时并将b页面上的一个参数回传给a页面并使a页面刷新呢?

解决方案 »

  1.   

    还有就是我在a页面上有select的下拉框,在弹出一个iframe的关闭事件是我可以将下拉框恢复显示,但是在b页面中的btn按钮中如何实现呢?当然还有上述的2项功能啊!
      

  2.   

    给 iframe里面的 button 添加个事件        var  ifm=window.frames[0].document
            var readyState = ifm.readyState;
            if(readyState=="complete")
            {
                ifm.getElementById("btn").onclick=function(){添加你的代码}
            }
      

  3.   

    Btn的cs代码    protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string Limit = getCheckBoxListSel(this.CheckBoxList1);
            ClientScript.RegisterStartupScript(GetType(), "", "this.window.opener.document.all.TextBox1.value='" + Limit + "';window.opener.location.href=window.opener.location.href;window.close();", true);
        }
      

  4.   

    是在btn中添加一个JS代码,对吗?
      

  5.   

    window.top.document.getElementById("a页面控件的值").value=document.getElementById("b页面要传的值").value;
    如果传值并刷新的话会回到初始状态,也就是没传值之前
    你直接赋值就可以
      

  6.   

    为什么不直接弹出b页面呢?要是直接弹出页面的话可以这样了:
    a页面js方法:
        getValue(v){
           document.getElementById(要赋值的元素).value = v;
        }
    弹出页面js方法:
        setValue(){
          var a = 要传递给a页面的值;
          window.opener.getValue(a);
          window.opener.location.href = window.opener.location;
          window.close();
        }<input type="button" onclick="setValue();"/>
      

  7.   

    <div id="addgg"><iframe id="addggs" src="***.aspx"  border="0" frameborder="0" height="100%" width="100%">您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。</iframe></div>/* 关闭事件 */
    $('iframe').load(function(){
        $(this).contents().find("#btn").click(function(){
    $('#addgg').hide();  //关闭,自己写代码
    });/* 获取框架里面的某对象的值 */
    $('iframe').contents().find('*****').val();
      

  8.   

    点击按钮<button id="iframe1" class="Btn">设置</button>JQ代码
    /*弹出消息层*/
    $(function() {
        $("#iframe1").click(function() {
        tipsWindown("设置字段","iframe:Default2.aspx","600","400","true","","true","id");
               
            //$("#ddlCom").hide();            
             allddl=document.all.tags("SELECT");   
             for(i=0;i<allddl.length;i++){   
                id=allddl[i].id;
                document.getElementById(id).style.display='none';
             }
            //$("#ddlCom").show();
        });
    });因为这个弹出层的同时要隐藏下拉框!
    B页面的Btn事件
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string Limit = "aaa";
           ClientScript.RegisterStartupScript(GetType(), "", "this.window.opener.document.all.txtziduan.value='" + Limit + "';
    window.opener.location.href=window.opener.location.href;window.close();", true);
        }在返回A页面值的同时使下拉框显示并是弹出层隐藏。上面btn的方法不行!求正解!