简体   繁体   English

ASP.NET-从iframe返回值到主页

[英]ASP.NET - return value from iframe to main page

I have an iframe on a usercontrol. 我在用户控件上有一个iframe。 I need to print webpage which I load on iframe dynamically. 我需要打印在iframe上动态加载的网页。 I am able to reach this far. 我能够做到这一点。 But I am not able to makeout whether user has actually printed or not. 但是我无法确定用户是否实际打印过。
I have javascript function print() called in the webpage on iframe. 我在iframe的网页中调用了javascript函数print()。
When print dialog is displayed, I need to know whether user selected OK(to print) or cancel and pass the same back to usercontrol. 当显示打印对话框时,我需要知道用户是选择确定(打印)还是取消并将其返回给用户控件。
Any ideas as to how this can be done. 关于如何做到的任何想法。

Thanks in advance. 提前致谢。

It cannot be done. 无法完成。 The browser will not inform you if the printing has been done or cancelled. 浏览器不会通知您是否已完成打印或取消了打印。

You can use onafterprint event to some extent but that is only supported on FF and IE. 您可以在某种程度上使用onafterprint事件,但是仅FF和IE支持。 On IE 10 for example, the event is fired before the print dialog is even opened. 例如,在IE 10上,甚至在打开打印对话框之前就触发了该事件。

https://developer.mozilla.org/en-US/docs/Printing https://developer.mozilla.org/zh-CN/docs/Printing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM