how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET

how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET
sp.NET DeveloperAsked:
Who is Participating?
 
Paul MacDonaldConnect With a Mentor Director, Information SystemsCommented:
Imagine anyone on any web site being able to force your printer to print something without your intervention.  Huge.  Security.  Failure.

The alternative solution is to bring up the printer dialog via one means or another, often by using the javascript window.print() command.  If you just want to pop the dialog up once the page is loaded you could do something like...

<script language=JavaScript>
window.onload = function () { window.print() };
</script>
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Can't be done, as far as I know.  This would be a huge security failure.
0
 
sp.NET DeveloperAuthor Commented:
Could you please elaborate regarding security failure? or please provide alternate solution.
0
 
sp.NET DeveloperAuthor Commented:
Thank you. Appreciated!
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Closing because the OP didn't and I was prompted to do it for him.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.