0

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

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Osama
  • 17
  • 1
  • 7

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,237
  • 1
  • 31
  • 49
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
  • 3,096
  • 1
  • 26
  • 46