0

How to auto fire key combination Ctrl+P from asp.net code ?

Soner Gönül
  • 94,086
  • 102
  • 195
  • 339
Osama
  • 17
  • 1
  • 6

2 Answers2

2

In Javascript: window.print();

https://developer.mozilla.org/en-US/docs/Web/API/window.print

To my knowledge, it's not actually standard, though people have been using it for a really long time. seealso: cross-browser print command?

Community
  • 1
  • 1
Warty
  • 7,010
  • 1
  • 28
  • 47
0

The fastest way will be a button with the javascript function window.print():

In your asp.net markup:

<asp:Button ID="printButton" runat="server" Text="Print" OnClientClick="javascript:window.print();" />

For more information you can look at this page or have a look at this code project site there are different solution to print sites

Martin
  • 2,500
  • 1
  • 24
  • 45