我想打开一个新的窗口,它同时包含面板打印为...如何打印(在新窗口)两个特定的面板ID
嗨,妳? 我很好.. !!
我使用这个脚本打印在头部
<head>
<scripttype="text/javascript">
functionPrintPanel() {
var panel = document.getElementById("<%=Pa1.ClientID%>");
varprintWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function() {
printWindow.print();
}, 500);
returnfalse;
}
</script>
</head>
在身体的一部分我有
<body>
<asp:ImageButtonID="print_btn"runat="server"
ImageUrl="~/images/awards2.jpg"OnClientClick="return
PrintPanel();"Height="50"Width="50"/>
<asp:Panel ID="Pa1" runat="server">Hi, How are u?</asp:Panel>
<asp:Panel ID="Pa2" runat="server">I am fine..!!</asp:Panel>
</body>
通过这一点,我将只得到“嗨,ü?”打印,但我想“嗨,你好吗?我很好.. !!”.....
不要ü想展示什么是有在面板上的一个新窗口? – 2013-05-09 11:55:05
我认为你需要让你的问题更清晰。 – 2013-05-09 11:56:12
@MicrosoftPS:是的。但也必须做它的纸张印刷...... – 2013-05-09 11:57:09