我想打印我的页面,接受母版页的元素。母版页中有一个用户控件,这对我来说很重要。我的打印按钮也在主页上。
谢谢..
您需要创建新的样式表 print.css 并设置 CSS media=print
例如 :
<style media="screen">
.noPrint{ display: block; }
.yesPrint{ display: block !important; }
</style>
<style media="print">
.noPrint{ display: none; }
.yesPrint{ display: block !important; }
</style>
并将“yesPrint”类添加到要打印的部分
<asp:ContentPlaceHolder class="yesPrint" id="MainContent" runat="server">
</asp:ContentPlaceHolder>
欲了解更多详情:http://www.codeproject.com/KB/HTML/Printing_with_CSS.aspx http://www.codeproject.com/KB/HTML/Printing_with_CSS.aspx
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)