如何在弹出窗口中打开HTML? [英] How to open html in pop up window?

查看:84
本文介绍了如何在弹出窗口中打开HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个返回HTML代码的函数,我想要做的是我想在弹出窗口中打开该函数返回的HTML.帮帮我,我该怎么做..我正在使用此代码..但是它给出了找不到资源"错误.在这里,我的Print Occupant函数返回html.

I have a function which returns an html code what I want to do is that i want to open html returned by the function in the pop up window. Help me how can i do that.. I m using this code..But it is giving "resource could not found " error. Here my Print Occupant function returns html.

<br />
string html = objEmailUtility.PrintOccupant(occupantsArrayList, objOccchkDTO);<br />
                    StringBuilder sb = new StringBuilder();<br />
<br />
                    sb.Append("<script>");<br />
                    sb.Append("window.open(''html'', '''', '''');");<br />
                    sb.Append("</script>");<br />
<br />
                    Page.RegisterStartupScript("test", sb.ToString());<br />


Plz指南


Plz Guide

推荐答案

< HEAD>
< SCRIPT LANGUAGE="JavaScript" type="text/javascript>
< !-- Begin
newWindow = window.open('','newWin','toolbar=yes,location=yes,
scrollbars=yes,status=yes,width=630,height=400')
The above line was broken in two for display purposes only!
newWindow.document.write
("<HTML>
< HEAD>
< TITLE>window!</TITLE>
< /HEAD>
< BODY bgcolor='#FFFFFF' text='#000000' background='../Images/RoughGrey.gif'>
< DIV ALIGN='center'>
< H1><font color='#990000'>This is pretty cool stuff!</font></H1>
< IMG SRC='../Images/HouseOfWacks.jpg' width='535' height='268'>
< /DIV>
< /BODY>
< /HTML> ")
newWindow.document.close
// End -->
< /SCRIPT>
< /HEAD>




OR

参考:

http://webwonks.org/WebBuilding/PopupWindows.html [




OR

Refer :

http://webwonks.org/WebBuilding/PopupWindows.html[^]

go to "Creating ad hoc pages and filling them with HTML" and check live example.


这篇关于如何在弹出窗口中打开HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆