By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Print Page

P: n/a
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
Dec 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"Peter" <pc*****@online.nospam> wrote in message news:OS*************@TK2MSFTNGP11.phx.gbl...
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
Dec 12 '05 #2

P: n/a
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" <na********@hotmail.com>
| References: <OS*************@TK2MSFTNGP11.phx.gbl>
| 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: <OT**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 203.36.211.134
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.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
| "Peter" <pc*****@online.nospam> wrote in message
news:OS*************@TK2MSFTNGP11.phx.gbl...
| 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
|

Dec 12 '05 #3

P: n/a

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Kj*************@TK2MSFTNGXA02.phx.gbl...
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" <na********@hotmail.com>
| References: <OS*************@TK2MSFTNGP11.phx.gbl>
| 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: <OT**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 203.36.211.134
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.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
| "Peter" <pc*****@online.nospam> wrote in message
news:OS*************@TK2MSFTNGP11.phx.gbl...
| 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
Dec 12 '05 #4

P: n/a
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" <pc*****@online.nospam>
| References: <OS*************@TK2MSFTNGP11.phx.gbl>
<OT**************@TK2MSFTNGP12.phx.gbl>
<Kj*************@TK2MSFTNGXA02.phx.gbl>
| 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: <#k**************@TK2MSFTNGP14.phx.gbl>
| 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!TK2MSFT NGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:364208
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:Kj*************@TK2MSFTNGXA02.phx.gbl...
| > 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" <na********@hotmail.com>
| > | References: <OS*************@TK2MSFTNGP11.phx.gbl>
| > | 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: <OT**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 203.36.211.134
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.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
| > | "Peter" <pc*****@online.nospam> wrote in message
| > news:OS*************@TK2MSFTNGP11.phx.gbl...
| > | 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
|
|
|

Dec 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.