Send Data to New Page for Printing ASP.NET

  • Thread starter Thread starter bhav
  • Start date Start date
B

bhav

Hi Guys,
I have a Web Forms' 'Table' control in my default.aspx page, along
with other controls. I wanted to implement a functionality where a
user can click a button to open the table's contents in a new
page/window for printing. Is this possible. I was thinking about
using Server.Transfer, and passing data via Context.Items collection.
First, it doesn't send any data to the page, and second, it opens in
the same window.

I wanted to know if there was any way to pass contents to a new page,
and open a new window to print.

Any help is much appreciated. Thanks!
 
If your intent is to create a "printer friendly" version of your page you
may want to look at the @media CSS rule in addition to Mr. Orr's suggestion.
It may not be applicable in your application but it's worth a look. If you
have certain content on screen that you do not want to print (ie: a menu
bar) you can use the @media rule to select which content is displayed on
screen vs. what is displayed on a print out. If it is feasibile in your
application then you may be able to avoid having to open another window.

The W3C and Microsoft have documentation on the rule.

http://www.w3.org/TR/CSS21/media.html

http://msdn.microsoft.com/library/d...author/dhtml/reference/properties/media_1.asp

Dave
 
Back
Top