473,804 Members | 2,280 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 2800
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.or g/wiki/Typeface
May 11 '07 #2

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

Similar topics

1
1604
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 asked to update pages as well as add new functions. This project is an online training course for internal use only. So, my question is.... I need to put a Print Button on the left frame called "buttons.aspx". I need it to print whatever...
0
1898
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) --------------------------------------------------------------------------------------------------------------------- <script language="JavaScript"> //Disable Mouse Right Click Button
1
4283
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()). However, I need to print to the server's printer. I need to print the fully rendered .aspx page from the codebehind .aspx.cs page to the server's printer. I've tried using SHDocVw.InternetExplorer and SHDocVw.WebBrowser but I just can't seem...
8
2536
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) Set wshobj=Nothing But I don't know how to do this in ASPX page (writen in C#).
4
1935
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 print button. When I click the print button, a new window must be opened and window.print() dialog box must be appear. But how can I do this? I have no idea. Please help. Best Regards, Ares
1
1437
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 special-sized labels of the same dimensions. However, whenever my users print, Internet Explorer sends the entire page (including the blank 2/3 of the page) to the printer, and therefore the printer prints out 1 label (containing the contents of the...
0
1160
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 debug mode in VS 2005, usign the VS built-in web engine. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestURLRewriter.aspx.cs" Inherits="TestURLRewriter" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
1
2518
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 does not actually display on the ASPX page. In my Screen CSS, I tried to use "Display: None" for that object (by ID). It will not print based on my various attempts to print that object (by ID) in my Print CSS. I would appreciate suggestions on...
4
1734
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 secure data to the web server and is cached for 10 seconds and returns a guid. when the winform loads, it passes in this guid as a param to find the data being cached. It then uses this data for various processing. Therefore, I can't simply...
1
1333
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 application
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10347
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.