I have the undermentioned code on my test.aspx page
<link href="main.css" rel="stylesheet" type="text/css" />
<link href="print.css" rel="stylesheet" type="text/css" media="print" />
The content I want to include in the print are enclosed under
<div class="print">content I want to print</div>
The undermentioned code is my print button:
<asp:Button ID="Button2" runat="server" onclientclick="window.print(); return false;" Text="Print"/>
Now my print.css file is as under and #left_nav, #right_nav, #heading1 are divs I dont want to print.
body {
color : #000000;
background : #ffffff;
font-family : "Times New Roman", Times, serif;
font-size : 12pt;
}
a {
text-decoration : underline;
color : #0000ff;
}
#leftnav, #rightnav, #masthead {
display : none;
}
.print {visibility:visible;}
My issue as explained in the other posts is to figure out a way to print just the text and not the form elements. So, if one of the fields is "name" , in the printed copy only the text entered in the field for "name" will be printed and not the small rectangular box surrounding the text box.