Print Page

P

Peter

ASP.NET 1.1
Does anyone has an example where user can click on an link or button and print the current page?


Thanks


Peter
 
P

Patrick.O.Ige

You can simply put a "print" button/link with the script "javascript:window.print()" to use the browser's print function.
Hope that helps
Patrick

ASP.NET 1.1
Does anyone has an example where user can click on an link or button and print the current page?


Thanks


Peter
 
S

Steven Cheng[MSFT]

Hi Peter,

I think you can just use the javascript "window.print()" as Patrick has
mentioned, if you're wondering how to make it bind with a html button's
click event, just use the following html code which bind the printing
script with the html button's click client event:

<html>
.....

<input type="button" value="print page"
onclick="javascript:window.print();" />

</html>

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Patrick.O.Ige" <[email protected]>
| References: <[email protected]>
| Subject: Re: Print Page
| Date: Mon, 12 Dec 2005 16:55:47 +1100
| Lines: 65
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_011A_01C5FF3C.E6E95860"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 203.36.211.134
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:364152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| You can simply put a "print" button/link with the script
"javascript:window.print()" to use the browser's print function.
| Hope that helps
| Patrick
| ASP.NET 1.1
| Does anyone has an example where user can click on an link or button
and print the current page?
| Thanks
| Peter
|
 
P

Peter

Steven Cheng said:
Hi Peter,

I think you can just use the javascript "window.print()" as Patrick has
mentioned, if you're wondering how to make it bind with a html button's
click event, just use the following html code which bind the printing
script with the html button's click client event:

<html>
....

<input type="button" value="print page"
onclick="javascript:window.print();" />

</html>

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Patrick.O.Ige" <[email protected]>
| References: <[email protected]>
| Subject: Re: Print Page
| Date: Mon, 12 Dec 2005 16:55:47 +1100
| Lines: 65
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_011A_01C5FF3C.E6E95860"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 203.36.211.134
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:364152
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| You can simply put a "print" button/link with the script
"javascript:window.print()" to use the browser's print function.
| Hope that helps
| Patrick
| ASP.NET 1.1
| Does anyone has an example where user can click on an link or button
and print the current page?
| Thanks
| Peter
|

Thank You very much, this is what I needed
 
S

Steven Cheng[MSFT]

You're welcome. :)

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Peter" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Print Page
| Date: Mon, 12 Dec 2005 07:46:59 -0600
| Lines: 64
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: cpe-69-23-74-9.new.res.rr.com 69.23.74.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:364208
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
|
| | > Hi Peter,
| >
| > I think you can just use the javascript "window.print()" as Patrick has
| > mentioned, if you're wondering how to make it bind with a html button's
| > click event, just use the following html code which bind the printing
| > script with the html button's click client event:
| >
| > <html>
| > ....
| >
| > <input type="button" value="print page"
| > onclick="javascript:window.print();" />
| >
| > </html>
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | From: "Patrick.O.Ige" <[email protected]>
| > | References: <[email protected]>
| > | Subject: Re: Print Page
| > | Date: Mon, 12 Dec 2005 16:55:47 +1100
| > | Lines: 65
| > | MIME-Version: 1.0
| > | Content-Type: multipart/alternative;
| > | boundary="----=_NextPart_000_011A_01C5FF3C.E6E95860"
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 203.36.211.134
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:364152
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | You can simply put a "print" button/link with the script
| > "javascript:window.print()" to use the browser's print function.
| > | Hope that helps
| > | Patrick
| > | > | ASP.NET 1.1
| > | Does anyone has an example where user can click on an link or button
| > and print the current page?
| > | Thanks
| > | Peter
| > |
| >
|
| Thank You very much, this is what I needed
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,199
Latest member
AnyaFlynn6

Latest Threads

Top