如何通过单击aspx.net中的打印按钮来打印网页内容 [英] how to print a web page content by clicking a print button in aspx.net

查看:111
本文介绍了如何通过单击aspx.net中的打印按钮来打印网页内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在asp.net中开发一个窗口应用程序,我想通过单击打印按钮来打印页面的某些数据.
请为此发送代码.......

I am developing a window application in asp.net i want to print some data of a page by clicking on a print button.
please send me code for this..........

推荐答案

您可以使用一段JavaScript代码:window.print();,将其与像<link href="CSS/Print.css" rel="stylesheet" type="text/css" media="print" />一样设置的css样式表,它隔离了您不想打印的元素.
You could it with a snippet of javascript: window.print();, combine this with a css style sheet that is set up like <link href="CSS/Print.css" rel="stylesheet" type="text/css" media="print" /> and isolates the elements you don''t want to print.


好吧,我简短地告诉您什么是数字人"试图告诉您:
这是询问者的期望:
1. 先尝试您要做什么!
2.制定看起来像问题/无法解决的问题.

尝试一下,告诉您是否遇到问题.
成员将很乐意为您提供帮助.

如果您仍然需要代码,那么我建议您使用另一个论坛: CP职位 [
Well, let me tell you in short what ''digital man'' is trying to tell you:
Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

If you still want code then I would suggest you another forum: CP Jobs[^]


这篇关于如何通过单击aspx.net中的打印按钮来打印网页内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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