2

新しいウィンドウを開きたいのですが、両方のパネル印刷が含まれています...

こんにちは、ご機嫌いかがですか?私は元気です..!!

ヘッド部分の印刷にこのスクリプトを使用します

<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>

これにより、「こんにちは、お元気ですか?」だけが得られます。印刷用ですが、「こんにちは、お元気ですか?私は元気です..!!」が欲しい.....

4

1 に答える 1