在Page_Load中读取数据库,怎样将得到的字符串写到一个iframe里去呢?
我现在是这样做的:
1。读取数据库,写到一个HiddenField,id是HTML里
2。Response.Write("<scriptanguage='javascript'>Show.document.body.innnerHTML=document.all(\'HTML\').value</script>");
这里的Show是iframe的id,但是总是提示Show未定义。我也尝试过在PreRender,Page_Load,LoadComplete等事件中使用,错误都一样恳请指教!

解决方案 »

  1.   

    protected string iframescript = "<scriptanguage='javascript'>Show.document.body.innnerHTML=document.all(\'HTML\').value</script>";然后在aspx中iframe定义的后面:<%=iframescript%>
      

  2.   

    弱弱得问下,一开始document.body是空,写入会报错。。
      

  3.   

    protected string iframescript = "<scriptanguage='javascript'>Show.document.write(document.all('HTML').value);</script>";然后在aspx中iframe定义的后面(也在form后面):<%=iframescript%>