Solved

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

Posted on 2016-10-10
5
16 Views
Last Modified: 2016-10-31
how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET
0
Comment
Question by:sp
  • 3
  • 2
5 Comments
 
LVL 33

Expert Comment

by:paulmacd
ID: 41837015
Can't be done, as far as I know.  This would be a huge security failure.
0
 

Author Comment

by:sp
ID: 41838544
Could you please elaborate regarding security failure? or please provide alternate solution.
0
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points (awarded by participants)
ID: 41838617
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
 

Author Comment

by:sp
ID: 41838621
Thank you. Appreciated!
0
 
LVL 33

Expert Comment

by:paulmacd
ID: 41866591
Closing because the OP didn't and I was prompted to do it for him.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now