473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Print Page

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
4 3040
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Steel | last post by:
Hi at all, I have a very long html page with many photo. Therefore the best to print this page is to print the some page as PDF. Therefore I maked a PDF file like my page to print best. I'ld want...
3
by: Umut Tezduyar | last post by:
In the msdn.microsoft.com/library most of the articles have an "print" option. But the "print" button is different from the javascripts "window.print()" method. It postpacks the page and then...
0
by: Paco Ferre | last post by:
Hello, I founded some examples of WebControl printing in internet and tryed to have them working for a DataGrid, something not very complicated. I have a page, Page1.aspx with a DataGrid...
16
by: Neal | last post by:
Hi, I saw the VB6 Code to do this at this link: http://www.dotnet247.com/247reference/msgs/11/56581.aspx The VB6 Code reads as follows: Private Type Rect Left As Long
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
22
by: stephen | last post by:
I have created an order form that users javascript to create a new html document when the customers clicks the "print page" button. Once the new document has been created it then prints the...
0
by: ShaneO | last post by:
There have been similar questions raised in the past, however no answers seem to have been provided, so I thought I'd give it a go. Scenario 1: My Windows Forms app generates (say) 10 pages in a...
4
by: CSharpguy | last post by:
My web app is using master pages, On the content page I'm using a GridView. I need to print my GridView and I need to exclude the HyperLink columns. How can I print my content page and exclude the...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
2
by: bob | last post by:
Hi, I have a page that has a collection of things which it passes to a second 'print' page using a session variable. The print page has buttons for moving though the collection and the user ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.