Help about using PrintDocument from aspx page
-
In my aspx program, while I invoking PrintDocument.Print method the page is always busy and never timeout. I try to debug it but the same situation happen so I can't solve the problem.... The same code section can run under winform project, but can't run under webform. anybody can help me? Thanks a lot.
-
In my aspx program, while I invoking PrintDocument.Print method the page is always busy and never timeout. I try to debug it but the same situation happen so I can't solve the problem.... The same code section can run under winform project, but can't run under webform. anybody can help me? Thanks a lot.
actually i want to print from the web server, not the browser my test code is as below when you click button1, the web page remain busy and no response and never throw exception or timeout Imports System.Drawing.Printing Public Class test Inherits System.Web.UI.Page Private WithEvents mPD As PrintDocument Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click mPD = New PrintDocument mPD.PrintController = New StandardPrintController mPD.Print() End Sub Private Sub mPD_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles mPD.PrintPage e.Graphics.DrawString("test", New Font(FontFamily.GenericSansSerif, 12), New SolidBrush(Color.Black), 10, 10) End Sub End Class