473,508 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to print an aspx page (in process)

2 New Member
Hi All!

I have a page say parent.aspx which has a link to voucher.aspx.
The link opens the voucher.aspx.
Instead of opening it I want to print voucher.aspx when i click on the link on parent.aspx.
(off course there are calculations behind voucher.aspx)
How can I achieve this?

I am working on .net 2.0 with C#.

plus

What things we need to consider in making a page print freindly?


pls help
May 11 '07 #1
1 2752
zottty
27 New Member
Hey!

As far as I know, there is no way to do this. Of course, if you have your p.asp and v.asp, you can always do some javascript tricks.

Maybe on v asp, you can do something like that:

Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'>
  2. function printme(){
  3.     document.print();
  4.     window.close();
  5. }
  6. </script>
  7. <body onload='printme()'>
  8. </body>
  9.  
And define different css for screen and print, like this:
[HTML]
<link rel="stylesheet" type="text/css" href="path/to/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="path/to/print.css" media="print" />
[/HTML]

And than you can just hide all of your contents with display:none in css.
Bit hacky, but hope I could work a bit.

To get a printer friendly page, I guess, the furst rule is to print it with a serif fontface and not a sans-serif, because this is designed for print.
http://en.wikipedia.org/wiki/Typeface
May 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1587
by: wolfiecat | last post by:
Hello - I am new to this forum. Let me start off by saying that I have never used ASP before. I am working on a project where the site was already created using frames and .aspx pages. I was...
0
1873
by: Niyazi | last post by:
Hi all, This my aspx page first line of code. <%@ Page CodeBehind="index.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="TB.index" %> Than inside head tag I have following script(s)...
1
4251
by: Robin Dindayal | last post by:
Does anyone know how I can print a fully rendered .aspx to the server's printer? I know that, if I wanted to print to the client's printer it would be easy (ie. use javascript's window.print()). ...
8
2523
by: Quentin Huo | last post by:
Hi: I want to run cacls.exe to check the user right from an ASPX page. In ASP, I can do: Set wshobj=Server.CreateObject("WScript.Shell") resobj=wshobj.Run("cmd /c echo Y| cacls c:", 0, True)...
4
1896
by: ares | last post by:
Hi! I'm a new bee in asp.net. I have a page that includes a table and a repeater web control, they have been filled dynamically with a stored procedure. So I would like to print this page with a...
1
1421
by: MrMike | last post by:
Hi. I have an aspx page which displays data on about the top 1/3 of the page, and the remaining 2/3 of the page is blank. The page is formatted so that my users can print the page to...
0
1146
by: dba123 | last post by:
Why isn't my aspx page rendering before the process() method call? What is happening is my aspx page never renders, and the debug is jumping straight into my process() method when I run in...
1
2505
by: =?Utf-8?B?THluZGE=?= | last post by:
In my web application, I am using two different CSS based on media. In my Print CSS, I can suppress button, header and ad objects using "Display: None;". However, I need to print an object that...
4
1714
by: moondaddy | last post by:
I have a .net 1.1 winforms app that calls an aspx page which I need to debug. I also need to start the debugging process from the winform because the winform first calls a web service which passed...
1
1312
by: SRIDHAR1245 | last post by:
i have have a asp x page that will gives final output just like bill format text .Than how i will print output from that asp x page through printer i am using .net 2.0 for developing the...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
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
7331
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,...
0
7391
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7054
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...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3204
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...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
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.