944,198 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 16607
  • ASP RSS
Nov 9th, 2005
0

How do i print asp page on client side "only the contents"

Expand Post »
How do i print asp page on client side ?
the code
<input type="button" value="Print" onClick="window.print()">
prints the entire asp page .if i want to print only the contents of the page and not the links and other stuff .How do i do it ?
Can I get a sample code for it .

Thank you
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rjadhav is offline Offline
3 posts
since Nov 2005
Nov 10th, 2005
0

Re: How do i print asp page on client side "only the contents"

Wel they way I use to print the whole page is by using the javascript to hide the things i dont want to appear on the print.
I use this javascript to hide the things, I pass the id of that particular HTML element whom i want to hide like the table, images etc...
Then you can call the print method to print the page.
ASP Syntax (Toggle Plain Text)
  1. function showhide(id)
  2. {
  3. var itm = null;
  4. if (document.getElementById) {
  5. itm = document.getElementById(id);
  6. } else if (document.all){
  7. itm = document.all[id];
  8. } else if (document.layers){
  9. itm = document.layers[id];
  10. }
  11. if (itm.style) {
  12. if (itm.style.display == "none") { itm.style.display = ""; }
  13. else { itm.style.display = "none"; }
  14. }
  15. }
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
msaqib is offline Offline
91 posts
since Sep 2004
Nov 15th, 2005
0

Re: How do i print asp page on client side "only the contents"

therwise just use the meta print thiny. it prints an entirely different page to the one showed. so set up 2 asp pages. 1 to be viewed, 1 to be printed
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Trusted connection in ASP with db
Next Thread in ASP Forum Timeline: Insert radio button value into MS Access database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC