如何在asp.net中打印页面? [英] How to print a page in asp.net?
本文介绍了如何在asp.net中打印页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hii,我想要打印一个页面,这是一个弹出窗口...
我正在使用方法window.print()但我在弹出窗口我有一个关闭按钮现在我想只打印所需的内容而不需要页面中的任何按钮...
有可能吗?有人可以帮帮我吗??
提前致谢....
Hii,I want to print a page and that is a popup...
I am using a method window.print() but i in tat popup i ma having a close button and now i want to print only the required content without any buttons in the page...
Is it possible?? can someone help me??
Thanks in advance....
推荐答案
为此您需要定义两个样式表一个用于媒体打印,另一个用于媒体屏幕
以下方式你可以在打印时为你想要的样式表提供一个链接
你在哪里可以应用显示:非你不想打印的东西
ex。
For this you need to define Two style sheet one is for media print and other is for media screen
following way you can give a link for the style sheet you want when it prints
where you can apply display:non for those thing which you dont want to print
ex.
#btnprint{
display:none;
}
<link href="../Contents/stylesheet/Printstylesheet.css" media="print" rel="stylesheet" type="text/css" />
和/或媒体屏幕你可以使用普通样式表,它应该如何找用户
and or media screen you can use normal style sheet , how it should look for user
<link href="../Contents/stylesheet/stylesheet.css" media="screen" rel="stylesheet" type="text/css" />
快乐编码
Happy coding
这篇关于如何在asp.net中打印页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文