打印时启用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.