我想打开一个新窗口,它包含两个面板打印...
嗨!你好吗?我没事..!!
我使用此脚本在 Head 部分进行打印
<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>
通过这个,我只会得到“嗨,你好吗?” 打印,但我想要“嗨,你好吗?我很好..!!”.....