Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii,I want to print a page and that is a popup...
I am using a method window.print() but i in tat popup i ma having a close button and now i want to print only the required content without any buttons in the page...

Is it possible?? can someone help me??

Thanks in advance....
Posted
Comments
Prasad Khandekar 22-Mar-13 4:16am    
Hello you can specify a different CSS for prnting purpose. Just make sure that the media attribute of that css is set to print. the browser will automatically use it while printing. In that css you can add a rule to hide the button.

1 solution

For this you need to define Two style sheet one is for media print and other is for media screen
following way you can give a link for the style sheet you want when it prints
where you can apply display:non for those thing which you dont want to print
ex.
CSS
#btnprint{
display:none;
}

script
<link href="../Contents/stylesheet/Printstylesheet.css" media="print" rel="stylesheet" type="text/css" />

and or media screen you can use normal style sheet , how it should look for user
script
<link href="../Contents/stylesheet/stylesheet.css" media="screen" rel="stylesheet" type="text/css" />


Happy coding
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900