如何在asp.net中通过打印机打印页面? [英] how to print page through printer in asp.net?

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

问题描述

亲爱的先生,

如何点击按钮发送打印请求...

i想要在纸上打印页面我点击按钮...

plz help ...

解决方案

< pre lang =cs> function printThis(){

window.print();

}< / pre>





< asp: button onclick =printThis(); xmlns:asp =#unknown>


参考以下链接



http://www.aspdotnet-suresh.com/2012/10/print-aspnet-gridview-data -using-c.html [ ^ ]

http://forums.asp.net/t/1561011.aspx?How+to+print+a+web+form+using+asp+net+用+ c + [ ^ ]


 <   script     type   =  t ext / javascript >  
window.print();
< / script >

当新页面打开或重定向时,如果你想点击按钮点击然后你做一个javascript函数并在点击按钮时调用onclick事件,这将有效。


Dear sir,
how to send print request whene click on button...
i want to do print page on paper whene i click on button...
plz help...

解决方案

<pre lang="cs">function printThis() {
window.print();
}</pre>


<asp:button onclick="printThis();" xmlns:asp="#unknown">


refer the below link

http://www.aspdotnet-suresh.com/2012/10/print-aspnet-gridview-data-using-c.html[^]
http://forums.asp.net/t/1561011.aspx?How+to+print+a+web+form+using+asp+net+with+c+[^]


<script type="text/javascript">
window.print();
</script>

this will work when new page open or redirected if you want to call on button click then you make a javascript function and call on onclick event on button click.


这篇关于如何在asp.net中通过打印机打印页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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