打印时启用aspx页面中的所有控件 [英] Enable all controls in a aspx page while printing

查看:88
本文介绍了打印时启用aspx页面中的所有控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





任何人都可以解决我的问题



如何只获取数据而不是控件使用打印机打印网页(.aspx)时。



例如包含数据sangeetha的文本框

当我按下打印按钮时文本框只会消失数据,即sangeetha应该打印。



请帮帮我。





问候,

Sangeetha。

Hi,

Can anybody solve my problem

How to get only data not with controls while printing a web page(.aspx) using printer.

for example a text box containing data sangeetha
when i press the print button the text box will disappear only data i.e, sangeetha should print.

Please help me out this.


Regards,
Sangeetha.

推荐答案

1。常用方法:创建全新页面,该页面仅包含您需要打印的数据的标签。根据您的需要格式化页面。添加一个具有@media打印样式的按钮display:none;该按钮应该调用javascript函数window.print();



2.如果你想保留你的页面而不必创建另一个:创建带有打印样式的CSS表格您的文本框和其他控件具有border:none和background-color =无论您的背景颜色是什么(或将其设置为透明) - 这样只有打印时才能看到数据。





如果你想了解更多谷歌的媒体相关CSS。



如果这有帮助请花时间接受解决方案。
1. Common way: Create completely new page that will contain only labels with the data you need printed. Format the page however you see fit. Add a button that will have @media print style display: none; The button should call javascript function window.print();

2. If you want to keep your page without having to create another: create CSS sheet with printing styles in which your text boxes and other controls have "border: none" and background-color = whatever your background color is (or set it to transparent) - that way only the data will be visible when printing.


If you want to know more google for "media dependant CSS".

If this helps please take time to accept the solution.


这篇关于打印时启用aspx页面中的所有控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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