I'm creating a print (preview)window, for which I want to load the core html from the site assets:

The code:


The html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Expires" content="0" />
<link rel="stylesheet" type="text/css" href="/SiteAssets/reporting.css" />
<title>Untitled 1</title>
<div id="printHeader">Reporting</div>
<div id="printBody"></div>
<div id="printFooter">Reporting Footer</div>

The popup opens, but I'm then asked if want to download the file. This doesn't happen in a normal asp.net env. So I'm assuming it has something to do whith the way sharepoint sets headers..

So how can I get the popup window to simply render the html?

2 Answers 2


Maybe you could use the default sharepoint popup-method?

<a href="javascript:SP.UI.ModalDialog.OpenPopUpPage('/SiteAssets/reportingPrintBase.html');">Do something</a>

You can set these parameters:

SP.UI.ModalDialog.OpenPopUpPage(url, callback, width, height);


  • url: The URL of the page to be shown in the modal dialog.
  • callback: The callback function that runs when the modal dialog is closed.
  • width: The width of the modal dialog.
  • height: The height of the modal dialog.

Is the html set up correctly in IIS? Looks like a mime/ content-type related thingie.. If not.. Have you tried another Browser?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.