打印模态弹出窗口的内容 [英] Print contents of a modal popup

查看:165
本文介绍了打印模态弹出窗口的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示项目列表的应用程序。

I have an application that shows a list of items.

用户可以点击一个项目,并在模态弹出式窗口JavaScript)。我需要在该弹出窗口上有一个按钮,允许用户打印出模态弹出框的内容。

The user can click on an item and see its details in a modal popup (centered DIV, shown using JavaScript). I need to have a button on that popup that will allow the user to print out the contents of the modal popup only.

这是一个需要工作的内部应用程序仅在IE7 +。当用户点击模态弹出窗口上的打印按钮时,项目的状态会更改为已打印(出于内部业务原因...)。

This is for an internal application that needs to work in IE7+ only. When the user clicks the print button on the modal popup the state of the item gets changed to "printed" (for internal business reasons...).

ASP.NET和 ASP.NET AJAX控制工具包ModalPopupExtender ,但我猜测,实现这一点的技术将是以浏览器为中心,并且服务器技术是不可知的。

I am using ASP.NET and the ASP.NET AJAX Control Toolkit ModalPopupExtender, but I am guessing that the technique to achieve this will be browser-centric, and server technology agnostic.

推荐答案

一个'noprint'类名到一个div包装你不打印的所有内容。

You could add a 'noprint' class name to a div wrapping everything you do not wish to print.

如果你还想要主页面可以打印没有对话框,你可以添加类

If you also want the main page to be printable without the dialog you can add class name to the wrapper DIV when the user presses the PRINT button and remove the class name after.

@media print {
.noprint {
 display:none
}
}

这篇关于打印模态弹出窗口的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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