I have been told to do this by using Response.Write
.
Whoever told you to do it this way is wrong, wrong, wrong.
If you need to make any kind of web page "printer friendly", then the right way to do it is via media queries
So if your page currently has CSS like this
<link rel="stylesheet" type="text/css" href="style.css">
Then you simply create a second style sheet that does everything you need to make your page "printer friendly, and then change your html to include the print
version.
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
Then in your print.css
stylesheet, you can use styles that are directly related to a print view. Some examples can be found in this link
/*Make your layout similar to a sheet of paper*/
body, #content, #container {
width: 100%;
margin: 0;
float: none;
background: #fff url(none);
}
/*Hide navigation, ads, and anything else you don't want printed*/
#topnav, #navbar, #nav, #sidebar, .ad, .noprint {
display: none;
}
/*Set a new default font*/
body {
font: 1em Georgia, "Times New Roman", Times, serif;
color: #000;
}
/*Style your headings*/
h1,h2,h3,h4,h5,h6 {
font-family: Helvetica, Arial, sans-serif;
color: #000;
}
h1 { font-size: 250%; }
h2 { font-size: 175%; }
h3 { font-size: 135%; }
h4 { font-size: 100%; font-variant: small-caps; }
h5 { font-size: 100%; }
h6 { font-size: 90%; font-style: italic; }
/*Display the links associated with hyperlinks*/
a:link, a:visited {
color: #00c;
font-weight: bold;
text-decoration: underline; }
#content a:link:after, #content a:visited:after {
content: " (" attr(href) ") ";
}