[SOLVED] Create Temporary Page


can someone point me to the right direction

I need a code to dynamically create a temporary Web Pop-up Page which I’ll declare the HTML Content in ASP.NET Using VB

reason for this function is that I am trying to make Application Form printer and I need to print the current page with the



You could generate the entire HTML as string and then use as below:

window.open("data:text/html;charset=utf-8,<head></head><body><h3>Test Document</h3></body><script>window.print();</script>");


window.open("data:text/html;charset=utf-8," + YOUR_HTML + "<script>window.print();</script>");

Copy paste the below script in a browser to test:

data:text/html;charset=utf-8,<head></head><body><h3>Test Document</h3></body><script>window.print();</script>

== Updates ==
Aspx.vb Code

Dim htmlText As String = "<head></head><bod‌​y><h3>Test Document</h3></body>".Normalize()
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "tempWindow", "<script>openTempWindow('" + htmlText + "')</script>", False)

Aspx Code

<script type="text/javascript">
    function openTempWindow(content) {
        var win = window.open("");

Answered By – Sunil

Answer Checked By – Clifford M. (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *