Currently, I am troubleshooting a printing issue on an ASPx Web Forms Page.
I have a 'Print' button that triggers the following event (print method):
private void MenuPrint_ItemClick(object sender, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
{
Response.RedirectOn("Print.aspx", "_blank", "menubar=0,scrollbars=1,width=780,height=900,top=10");
}
Upon clicking the 'Print' button, a new window 'Print.aspx' opens. Here is what is contained on this page:
protected void Page_Init(object sender, EventArgs e)
{
LoadData(); // generate print document
Response.Write("<script language=javascript>window.print();</script>");
}
However, there is a problem:
The window.print() function opens the Google Chrome printing menu, which blocks the old window where the 'Print' button is located.
When I close Print.aspx by clicking [X], List.aspx window remains blocked. If I click 'Anuluj' (which means Cancel) and then close List.aspx, it functions properly without any blocks.
After some investigation, I found that there are no other options to print the document, nor can I handle the 'Cancel printing' button.
My question is how can I prevent this blocking issue. Should I use something other than RedirectOn?