如何在asp.net中打印面板 [英] how to print panel in asp.net
本文介绍了如何在asp.net中打印面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我想打印放置在面板控件中的控件,是否可以给我指南或发送任何摘录
hello,
I want to print controls which are placed in panel control ,can u give me guide lines or send any snippets
推荐答案
使用PrintHelper
如何在ASP.NET 2.0中打印
Use PrintHelper
How to Print in ASP.NET 2.0
嗨
试试这个例子:
Hi
try this example:
<blockquote class="FQ"><div class="FQA">Quote:</div><script type=’text/javascript">
function printform()
{
var printContent = document.getElementById(’<%= pnlForm.ClientID %>’);
var windowUrl = ‘about:blank’;
var uniqueName = new Date();
var windowName = ‘Print’ + uniqueName.getTime();
var printWindow = window.open(windowUrl, windowName, ‘left=50000,top=50000,width=0,height=0′);
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
</script>
<asp: Panel runat=’server’ id=’pnlForm’ >
<asp:GridView is=’grd1′…[gridview, datasource markup goes here]
</asp: Panel>
<input type=’button’ value=’print’ önclick=’printform();’ /></blockquote>
希望这会有所帮助
最好的问候,
Hope this helps
Best Regards,
这篇关于如何在asp.net中打印面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文