C# – How to select a different printer in a web application

asp.netcprinting

I have a Web application programmed in C#.

There are several printers and I want to choose any of them and execute the action, I would like some kind of Form to load all printers.

I found this for Win forms:

this.printDialog1.Document = this.printDocument1;

DialogResult dr =  this.printDialog1.ShowDialog();

But I couldn't find something for ASP.NET.

Thanks for any help.

Best Answer

You really can't do it from a web app, if it was allowed then pop-up loving sites all over the internet would I'm sure be accounting for most of the worlds ink usage.

I had this issue when building a web app for a college, the most its possible to do is call up the print dialogue and have the user select the printer (best to have a decent print targeted CSS here):

javascript:window.print();

Its not perfect but to be honest although they insisted on it when it was put in a year ago, emails and PDF's are much more widely used.