![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| Hi, I have this code on the page which displays a image. <a href="print.asp?id=<%=ID%>"><img src="/image/imglink.gif" border="0" /></a> When a person clicks on the image it opens up print.asp What i want to do is when a person clicks on the image i want to print the page print.asp i tried window.print but its not working can someone tell me what i am doing wrong todd |
| Sponsored Links |
|
#2
| ||||
| ||||
| On print.asp, just call the window.print in the body onload event: Code: <body onload="javascript:window.print();">
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#3
| |||
| |||
| I tried it buddy it works But my problem is I dont want to display print.asp to the user I just want it to be printed is there a way I can make it happen also when the page is printed It shows the URL at the bottom of the page Can i hide that url todd |
|
#4
| ||||
| ||||
| Printing support in browser basically sux. The URL footer is controled by the Print Setup function of the user's Browser, so I know of no way to suppress this. I also don't know of a way to keep the page from displaying.
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
|
#6
| ||||
| ||||
| I use this activex control. Means users have to install it onto their machine, but it allows you to control the margins, header, footer etc. Linky I also don't know of a way to print the page without displaying it. It's just printing whatever is displayed in the browser so if there's nothing there it won't print anything. You can open the page and call a JS function onload that prints the page, either using this activex or as shown above and then use window.close to immediately close the window. Hope that helps. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Print out data on a letterhead format | Shem | .Net Development | 3 | May 22nd, 2008 09:15 AM |