我怎么知道用户是否真的点击了打印弹出的打印按钮。 [英] How Do I Know If User Has Really Clicked On Print Button Of Print Pop Up.

查看:262
本文介绍了我怎么知道用户是否真的点击了打印弹出的打印按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,在aspx页面上有3-4个文本框和一个打印按钮。

如果用户实际打印该页面,我的要求是保存数据库中的文本框值。





我使用Window.Print打印该页面。但是我怎么知道用户之后是否点击了打印按钮或取消按钮。



提前谢谢,

I have a scenario where there are 3-4 textboxes on aspx page and a print button.
My requirement is to save values of textboxes in database if user actually prints that page.


I am using Window.Print for printing that page. But How would I know if user has clicked in print button or Cancel button afterwards.

Thanks in advance,

推荐答案

打开打印预览对话框后,您无法控制用户的活动。



但是,您可以做某事,单击页面上的打印按钮时。在打印按钮单击事件上执行操作,然后调用 window.print()
You can't have any control of user's activity once Print Preview Dialog is opened.

However, you can do something, when the Print Button on your page is clicked. Do something on Print Button Click event and after that, call window.print().


这篇关于我怎么知道用户是否真的点击了打印弹出的打印按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆