Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 22nd, 2004, 02:23 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default Print Page

I have a page in ASP which has some buttons like Print and Back. This page is in printable format. But the problem is that I want to remove that buttons from print that is when page is printed there is no button display on the page
If any one has the idea that how can I do this ?
Please tel me I wil be great full to him

(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is how you got it
__________________
(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is  how you got it
 
Old October 22nd, 2004, 03:28 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Try

<input type="button" onclick="print();this.style.display='none'" value="Print">

You can also do this in CSS - I forget how, something like:

print {display:none;}

Wind is your friend
Matt
 
Old October 22nd, 2004, 04:27 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Dear Matt I works.but in the following way like

onClick=" this.style.display='none'; Submit.style.display='none'; print(); "

But the problem is that after printing the page the Submit button is also hide how can I show it after printing the page?


(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is how you got it
 
Old October 22nd, 2004, 04:37 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Numan,

As Matt mentioned, you can do it with css, add the following to your page:
Code:
<style type="text/css">
@media print{
    .NoPrint{
        display: none;
    }
}
</style>
and then set the class attribute of your button to "NoPrint"

HTH,

Chris

 
Old October 22nd, 2004, 05:01 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Thanks ChrisScott it is quite nicely working



(*_*)

Numan
--------------------------------------------------
It is not important what you get But important is how you got it





Similar Threads
Thread Thread Starter Forum Replies Last Post
Part of page won't print? Ron Howerton HTML Code Clinic 2 May 28th, 2008 10:01 PM
Print a page without changing page setup nrajeshatwork Servlets 1 May 23rd, 2007 10:09 AM
Can not do a Page Print? cavanami BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 March 4th, 2007 09:57 AM
print page that is not the current page crmpicco Javascript How-To 0 July 26th, 2005 09:11 AM
print the hidden page without the print dialog box kayzem Classic ASP Basics 0 April 21st, 2005 11:31 PM





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