0

I am having a datalist inside a div. I want to print it.
The code has been done for printing on a button click but opens the print dialog form in the same tab itself..
what I want is to open the print dialog box in another tab so that if I don't want to print it i can simply close the tab and start working normally with my form...

I am using the following code at design time.

<asp:Button ID="btnprintlabel" OnClientClick="printdiv('div_print');"  
            Text="PrintLabel" Width="132px" onclick="btnprintlabel_Click" 
            Font-Bold="True" Visible="False" runat="server" />
शेखर
  • 17,412
  • 13
  • 61
  • 117
smita kapse
  • 31
  • 3
  • 11

1 Answers1

-1

You can simply use same views, but have 2 CSS files (one with media="screen" and the other with media"print").

Detail

The media"print" applies only when you give print command to your page.
You can hide other controls in this css and print your page.

You can go through the following links

  1. Asp.net..Printing
  2. http://haacked.com/archive/2006/03/13/CSSBasedPrintingTip.aspx

Edit 1

If you don't want to use above simple go through this link
Print the contents of a DIV

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117