Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2004, 03:51 PM
Authorized User
Join Date: Jan 2004
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default excluding html from printer ..

i know this is not the place for html .. but just asking ...

how do i exclude some html say a button from being printed ..

i cant use frames .. so what i want is exclude some text or graphics from printing with disrupting the way it is displayed on browser...

Reply With Quote
  #2 (permalink)  
Old February 3rd, 2004, 04:09 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

If you know it's not the place for HTML, why do you post here? ;) There is a good HTML list a few clicks lower on the page....

You can use some CSS to hide the stuff you don't want to display when the page gets printed. Modern, standard compliant browsers support embedding a style sheet specifically for print media. Inside that style sheet, make sure the elements you don't want to be printed are hidden. Consider the following example that hides an HTML form button when the page is printed:
    <title>Non Printable STuff</title>
    <link href="/Styles/MainStyle.css" rel="stylesheet" type="text/css">
    <link href="/Styles/PrintStyle.css" rel="stylesheet" type="text/css" media="print">

<input type="button" value="I am hidden" style="NonPrintable">

As you can see, two stylesheets are linked in the head section. One for ordinary, on-screen style stuff. The other has been marked with media="print" which means it is only used when the page is printed.

To actually hide the button when the page is printed, you'll need to add the following definition for the NonPrintable class to the second stylesheet:
    display: none;
I usually use this trick in combination with a reversed, PrintOnly class that only outputs stuff when the page is printed (like the full address of the page, for example).



Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excluding certain records from a search RussLewis XSLT 5 March 4th, 2008 12:14 PM
Excluding Rows fs22 SQL Language 2 August 17th, 2005 12:58 PM
Printer.Printer Problem!! Pls Help Me Chamin Access VBA 0 December 10th, 2004 07:08 AM
excluding archives of a folder thomaz C# 4 March 8th, 2004 09:09 AM
Excluding items with certain keywords ashcarrot SQL Language 4 July 23rd, 2003 10:04 AM

All times are GMT -4. The time now is 04:25 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.