Printing Client side in ASP.NET

  • Thread starter Thread starter aniljain50
  • Start date Start date
A

aniljain50

Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil
 
Hi All,
I have a web form. let's say it has 3 fields. Employee No, Name ansd
salary. Now my problem is I want to print the contents of this screen
to a local printer. Note that this is client side printing and not
server side!!
I do not want to print the screen but the contents of the screen
(Employee No, Name and salary).
Also is there a way that the printer dialog will not appear while
printing.

Thanks in advance!!

Regards
Anil

As Christiaan said, you can use css to specify what content should be
hidden from the printer.
It is not possible to print client-side without that print-dialog, it's a security
feature. Imagine what would happen if some of the "less polite" sites
where able to print anything without you being able to stop it!

Hans Kesting
 
All you have to do is wrap the fields inside a div tag, then send the div
tag to a client side script and call InnerHTML method of div tag to send to
new window. This is really a client-side scripting issue.
 
Back
Top