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

"Print this Page" MSDN Style

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.