Printing asp.net pages

K

King Coffee

Hi,

Can some one tell me how I can programmatically print a web pages.

Thanks,
King
 
G

Gregory A. Beamer

Hi,

Can some one tell me how I can programmatically print a web pages.

Thanks,
King

Adding a JavaScript print button is fairly easy. There are plenty of
examples you can Google.

Making the page look good on print is as easy as creating a secondary
CSS for print.

Mark's option of creating a PDF of the page also works. You have the
button create the PDF in a "temp" location and then redirect the user to
the file created.

peace and grace,
 
E

Eliyahu Goldin

And the javascript will be windows.print()

But it will open the Print dialog box, in the same way as when you click
browser's Print command.


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://blogs.microsoft.co.il/blogs/egoldin
http://msmvps.com/blogs/egoldin


Gregory A. Beamer said:
Adding a JavaScript print button is fairly easy. There are plenty of
examples you can Google.

Making the page look good on print is as easy as creating a secondary
CSS for print.

Mark's option of creating a PDF of the page also works. You have the
button create the PDF in a "temp" location and then redirect the user to
the file created.

peace and grace,



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4367 (20090825) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4367 (20090825) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
G

Gregory A. Beamer

That's correct. The OP is looking (IMO) for a way to print directly to
a client-side printer bypassing the print dialog, which is why I
advised him to forget it...

Oops! I guess I did not pay attention to the "I don't want to give my
users a choice" part of the post. ;-)

peace and grace,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top