Answered by:
ASP.Net Print Document

Question
-
How to print the document or webpage in printer using asp.net
- Moved by Jason Dot Wang Tuesday, October 8, 2013 9:27 AM This thread is about ASP.NET
Thursday, October 3, 2013 6:09 AM
Answers
-
I think it is not possible to print a webpage without displaying the print dialog box.
Please refer this link for detailed explanation.
- Proposed as answer by Ravi kumar Kantipudi Thursday, October 3, 2013 7:26 AM
- Marked as answer by Just Karl Friday, October 18, 2013 3:01 PM
Thursday, October 3, 2013 7:16 AM -
Please post ASP.NET questions in the ASP.NET forums (http://forums.asp.net ).Thursday, October 3, 2013 2:30 PM
All replies
-
Hi
Please try this code in code behind
protected void PrintBtn_Click(object sender, EventArgs e) { ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "window.print()", true); }
Thursday, October 3, 2013 6:35 AM -
but i want assign the printer path and i take printout (for example : \\DinaZ-pc\Canon LBS2900) this is printer pathThursday, October 3, 2013 6:47 AM
-
I think it is not possible to print a webpage without displaying the print dialog box.
Please refer this link for detailed explanation.
- Proposed as answer by Ravi kumar Kantipudi Thursday, October 3, 2013 7:26 AM
- Marked as answer by Just Karl Friday, October 18, 2013 3:01 PM
Thursday, October 3, 2013 7:16 AM -
Yes Sekahar, You are right. the code what you have given "ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "window.print()", true);" will open print dialogue box at client end and then he need to give printer details.Thursday, October 3, 2013 7:26 AM
-
Ya i understand but my requirement print at server side using Network printer or IP printer that print documents also. . . .
dinesh
- Edited by Dinezh Thursday, October 3, 2013 8:43 AM
Thursday, October 3, 2013 8:42 AM -
Ofcourse. But definetley if it is an Asp.net application then there is no point in talking about printing from server side, because content will be on client side. Or else if you are interested in printing some log file that is generated at server environment. In that case the following link can be helpful for you...
http://msdn.microsoft.com/en-us/library/windows/apps/hh465204.aspx
http://www.codeproject.com/Articles/24467/Administering-Printer-Settings-in-C-for-Flexible-P
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printersettings.aspx
- Edited by Ravi kumar Kantipudi Thursday, October 3, 2013 10:51 AM
Thursday, October 3, 2013 10:43 AM -
Please post ASP.NET questions in the ASP.NET forums (http://forums.asp.net ).Thursday, October 3, 2013 2:30 PM