473,763 Members | 8,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Print this Page" MSDN Style

Hi all,

I am implementing a "Print this Page" function in my ASP.NET application.
This function should print a part of the page and I would like to use an
MSDN Style "Print this Page".

I'm going to explain what I would like to do.

Clicking on the print button I would like to show immediately the print
dialog without open a new window with the text formatted for printing.

Now if I implement the window.open() on the onclick event of the button it
works like I want but it prints the entire page instead of printing the
portion of a page I want.
I know this is normal, but I would like to implement a behavior like MSDN to
print a part of the web form with just a click without open any additional
window.

For an example of what I am saying check this MSDN article and try to print
it.

http://msdn.microsoft.com/library/de...AppArchCh2.asp

Thank you all
Nov 19 '05 #1
1 2295
Clicking on the print button I would like to show immediately the print
dialog without open a new window with the text formatted for printing.
I'd suggest NOT doing that. For one, it doesn't work in every browser.
Secondly, people like to see what they're about to print. Thirdly, a lot of
people actually prefer to read the 'print friendly' version of the page on
screen rather than actually printing it.

Just some things to consider.
Now if I implement the window.open() on the onclick event of the button it
works like I want but it prints the entire page instead of printing the
portion of a page I want.
You need to use CSS for this. You create a CSS file for on-screen rendering
and you create a separate one for print rendering. with your method, you
simply create a print CSS file. For a 'print friendly' page, you'd create a
second CSS file and swap it server-side with some back-end logic.
For an example of what I am saying check this MSDN article and try to print it.

http://msdn.microsoft.com/library/de...AppArchCh2.asp

In this case, it's because MSDN is all frames based...it's just printing one
particular frame.

-Darrel
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3564
by: Albert Wagner | last post by:
I have just had a problem that I cannot find any reference to in any docs. Admittedly, I am a JavaScript newbie, but this sure seems like a bug or an "undocumented feature" in Opera 7.11. I have some debugging code that writes messages to a TEXTAREA. I named the function that writes to the TEXTAREA "print", e.g. content = ""; cnt = 0; function print(aLine) { content += (aLine + "\n");
17
2392
by: Geoff Cox | last post by:
Hello, I am trying to have 1. web pages in large font 2. web pages with smaller font for printing I am using <link rel="stylesheet" media="print" type="text/css"
8
3355
by: Tony | last post by:
Hello I am learning C# and encountered the following problem when I tried to figure out how to print the string {0} in a Console window The following piece of codes complied OK. But when I ran it, it failed The codes are using System class Test
5
1880
by: Paul Sullivan | last post by:
We are a state agency that views protected medical information via our intranet. The screens even have privacy shields. Alarmingly, uses can "Print" and "Save As" which destroys the protection of the health information at the level we want. QUESTION: Can we shut those off?? Any other suggestions?? Paul Sullivan
2
3402
by: Goethals Frederik | last post by:
hi, I have a little problem with the function "Page.GetPostBackClientHyperlink". First some description of my page: It is a simple testpage for testing "selecting a row af the datagrid by clicking on the whole row". After some googling I thought I found a solution (see code below) I have a datagrid with 1 Select-column (via the property-building in VS.NET) and some auto-generated colums with data. The "Select-column" is the first column...
1
2323
by: Steff | last post by:
I am wandering if my code is making sense... I use a lot the print function. Is it weird in this case where I have to display an array ? I thought it would be better to have the entire array in php but now I am not sure if that makes sense. Can you tell me please ? <html> <head>
45
9127
by: Umesh | last post by:
please help. thanks.
0
1270
by: moti far | last post by:
hi, i use stylesheet to design the plot of the print page. The page works with https(ssl) protocol. this my code: <html> <head>
4
3102
by: lander | last post by:
I've read the page life cycle thing in msdn, still, i'm getting a bit confused of thinking how all the things are going under the hood... I know that when page loading, that the controls' properties is populated and when page unloading, the resources are cleared. What I want to know is what's happening behind it, that is, from the perspective of the asp.net implementor.....I'm not sure whether i've stated clearly, hope you get it.
0
9564
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
9387
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
10002
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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
9823
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
8822
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...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2794
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.