父窗口将window对象作为参数传入
sReturn = showModalDialog("xxx.htm", self, '');子窗口中取window参数,然后同样按照DOM取控件
win = window.dialogArguments;
win.document.getElementById("xxx");

解决方案 »

  1.   

    需要传递参数
    window.showModalDialog("b.html", test1)然后在子窗口 取参数var id = window.dialogArguments; id.document.getElementById("id") 的方法调用。
      

  2.   

    需要传递参数 
    window.showModalDialog("b.html", test1) 
    这句话是什么 意思?  test1 是干嘛用的?
      

  3.   

    showModalDialog的第二个参数就是传递一个对象到子页面,
    任何类型都可以,你要调用按钮就把按钮当作第二个参数传进去,
    在子页面用window.dialogArguments接收就行勒~
      

  4.   

    dialogArguments.document.getElementById("id").click();
    id就是父页面的按钮ID
      

  5.   

     楼上的答案给的差不多了,我补充下,a.html 里面:
    win=window.showModelessDialog("b.html",window,"dialogWidth=200px;dialogHeight=200px;status=0;scroll=no") b.html 中调用父窗口对象:
    window.dialogArguments.对象ID;
    貌似直接用 parent.对象ID 就可以调用捏。 楼主试下,记不清楚了。
      

  6.   

    我在子頁面 里 這么寫 對么?  
    window.dialogArguments.document.getElementById("<%=sCWaRiTsuKeButton.ClientID%>").click(); sCWaRiTsuKeButton 是 父頁面 的的 一個按鈕 并且 runat=‘server’
      

  7.   

     你要确定父页面有没有这个 <%=sCWaRiTsuKeButton.ClientID%> ID 编号,如果有的话,按照我们上面的方法调用就可以,不行的话,在来说明出现的问题。
      

  8.   

    頁面只有  sCWaRiTsuKeButton ,但是他是服務器控件, 小頁面應該如何取呢
      

  9.   

    服务器控件生成的html是不变的吧.
    直接取生成的html控件ID
      

  10.   

    正确
    服务器控件,如果是.net,win.document.getElementById("<%sCWaRiTsuKeButton.ClientID%>")
      

  11.   

    少了个=,win.document.getElementById(" <%=sCWaRiTsuKeButton.ClientID%>")