打印时启用aspx页面中的所有控件

编程入门 行业动态 更新时间:2024-10-28 20:21:33
本文介绍了打印时启用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页面中的所有控件

本文发布于:2023-11-11 11:39:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578336.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   页面   aspx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!