I've already made a button that loads the printing screen on the page, but now I'm trying to make a button that is on "Page 1" and if pressed, loads the printing screen of the "page 2". Is it possible?

I would be really surprised if this worked, JavaScript in browser tries really hard to keep windows from talking to each other.


Maybe this works. When button on Page 1 is pressed navigate/submit to Page 2 and pass a parameter. In Preparation of Page 2 check for the parameter and use HttpRequestHandler.RunJavaScript to open the print dialog.

Fabian -

I think it depends on what he means by "page 2". Is he trying to control a page that is already loaded in the browser in another tab/window?


I think there's no easy way to do this. However, If in your scenario the page 2 has been opened by the screen that contains the button that loads the printing screen, you can try to hold the reference of the page 2, set the focus to it and print. Something like this:

var printWindow = window.open('http://server/module/printPage.aspx', '_blank');

Hope it helps.

André Siébra.