-2

I am looking for some samples or directions on how to print an aspx page. On the page, I have a set of edit boxes and buttons and grids filled with information. Using the following JS code of course I'm able to bring up the Printing dialog and it prints the page but How can I avoid printing or displaying buttons, lines, grids and etc on the output?

Or in general, how can I manage or customize the layout of my output?

<asp:Button ID="btnPrint" runat="server" Text=" Print " CssClass="btn btn-info" OnClientClick="javascript:window.print();" />

Thanks. Ak

amit kohan
  • 1,612
  • 2
  • 25
  • 47
  • this is not hard to research and research is expected before asking questions here. A web search or [SO site search](http://stackoverflow.com/help/searching) should have given you lots of results – charlietfl Jan 29 '17 at 00:24

1 Answers1

1

with @media queries in your css:

@media print {
  .btn {
    display: none;
  }
}
tklg
  • 2,572
  • 2
  • 19
  • 24