我在寫網頁中用到<iframe>,並將它的Src設定為一個空的網頁,在用response.write("...")寫信息時,在我當前的網頁和<iframe>中都顯示了信息,但我只想讓它在<iframe>中顯示,該怎麼做?

解决方案 »

  1.   

    System.Text.StringBuilder s = new System.Text.StringBuilder();
    s.Append("\n<script language=\"vbscript\">"+"\n");
    s.Append("Sub Window_OnLoad()\n");
    s.Append("window.fre.document.url = \"OtherPage.aspx"+"\"\n");  //fre是iframe的ID
    s.Append("END SUB\n");
    s.Append("</script>\n");
    Page.RegisterStartupScript("ddd",s.ToString());
      

  2.   

    大哥,我是用VB.net寫的!我的代碼如下:
    Shared Function ShowMessage(ByRef webform As UI.Page)
            Dim i As Integer
            i = UBound(message)
            Dim line As Integer
            Do While line < 15 And i >= 0
                webform.Response.Write(message(i) & "<br>")
                i -= 1
                line += 1
            Loop
    End Function
      

  3.   

    iframe中本来就是另外一个网页,你再做一个网页完成这些功能不就行了,为什么要在当前页中向iframe写内容呢?
      

  4.   

    不好意思,我看错了问题!!!用VBscript往这个页面里脚本写不就行了吗?
      

  5.   

    也就是說,在我當前的網頁中有一個<iframe>,<iframe>的Src指向一個網頁,在此網頁中有一個文本框控件,我怎麼樣才能在噹前的網頁中,找到<iframe>中網頁的文本框。
      

  6.   

    try.........
    <iframe id="frm"></iframe>
    ......
    Response.Write "<script>document.all('frm').write('message');document.all('frm').close();</script>"