1、我点击button的onclick执行window.open('a.aspx');
2、然后在关闭a.aspx的时候执行window.opener.document.getElementById('ctl00_HyperLinkTrasact').click();
   其中'ctl00_HyperLinkTrasact'是asp:HyperLink控件
以上执行正常-----------------------------3、当我把第一步换成window.showModalDialog('a.aspx');然后再关闭的时候执dialogArguments.document.getElementById('ctl00_HyperLinkTrasact').click(); 怎么就不执行了呢????

解决方案 »

  1.   

    ShowModalDialog函数的功能:打开一个子窗口,并且可与父窗口相互传递数据,它与window.open的最大区别就在于由ShowModalDialog打开子窗口后,父窗口将不能操作
      

  2.   

    window.showModalDialog('a.aspx');
    if (return==1)
    {
    dialogArguments.document.getElementById('ctl00_HyperLinkTrasact').click(); 
    }
      

  3.   

    直接用不行? document.getElementById("ctl00_HyperLinkTrasact").click();
      

  4.   

    我想原因是因为window.showModalDialog的时候页面的进度条还是在滚动的,要等窗体关闭后,整个页面才刷新完全,而我是在window.showModalDialog('a.aspx');后面就执行dialogArguments.document.getElementById('ctl00_HyperLinkTrasact').click(); 所以数据还不会刷新过来,如果我用location.reload();是可以达到数据刷新的效果。但是如果用reload的话,就会出现可恶的“若要在显示……”的提示框。
      

  5.   

    如果用location = location;也是没有达到数据刷新的效果。