我想问两个ASP。NET上面的问题:
1.
我首先在背景页面上打开一个页面,这个BB页面需要添加一些资料,操作完后关闭该页面,这样我在点击刷新的时候就会跳出BB页面,该怎么解决呢,我就想用服务器的控件2.就是我点击按钮之后为什么背景页面不刷新呢
代码是这样的
string strScript = "window.alert('操作成功');window.returnValue=true;window.focus();window.opener=null;window.close();";
        
      ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "成功", strScript, true);

解决方案 »

  1.   

    刷新父页面用 parent就行啊。
      

  2.   

    举个例子:
    背景页面:
    有一个text框代码:<input id="Text1" type="text" />
    一个Button,调用BB页面的代码:
     ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "window.open('BB.aspx')", true);BB页面:
    一个Button,按Button后刷新背景页面并将"aaa"传给背景页面中的text框,代码:
    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "成功", "window.opener.document.getElementById('Text1').value='aaaa'; window.opener.location.href=window.opener.location.href", true);楼主试试!!
      

  3.   

    第一个问题我没说明白,不好意思,我再解释一下,
    我首先在背景页面上打开一个页面,这个BB页面需要添加一些资料,操作完后关闭该页面,
    这样我在点击刷新的时候就会跳出BB页面(我是不想让它跳出来),该怎么解决呢,我就想用服务器的控件 
      

  4.   

    有一个text框代码: <input id="Text1" type="text" /> 
    一个Button,调用BB页面的代码: 
    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "", "window.open('BB.aspx')", true); BB页面: 
    一个Button,按Button后刷新背景页面并将"aaa"传给背景页面中的text框,代码: 
    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "成功", "window.opener.document.getElementById('Text1').value='aaaa'; window.opener.location.href=window.opener.location.href", true);