I am working on ASPx Web Forms Page and have problem with printing page.
I have button 'Print' which calls 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");
}
after I press 'Print' button it opens new window 'Print.aspx' and this is which is on this Page:
protected void Page_Init(object sender, EventArgs e)
{
LoadData(); // generate print document
Response.Write("<script language=javascript>window.print();</script>");
}
and now it's the problem:
window.print(); will open google chrome printing menu, which block old window (that window where is 'Print' button.
When I close Print.aspx by clicking [X] List.aspx windows will be still blocked. When I press 'Anuluj' - which means Cancel and then press [X] List.aspx won't be blocked. Eveything will be fine.
I make some research and figure out that there is no more options to print document, also I can't handle 'Cancel printing' button.
Question is how to avoid that block, maybe I should use something other instead RedirectOn?