在c#中使用javascript打印面板但我想在页脚上添加页码

时间:2016-10-03 06:44:18

标签: javascript c# asp.net

在c#中使用javascript打印面板,但我想在页脚上使用页码

我的代码js

        <script type="text/javascript">
            function PrintPanel() {
                var panel = document.getElementById("<%=pnl_print.ClientID %>");
                      var printWindow = window.open('', '', 'height=400,width=800');
                      printWindow.document.write('<html><head><title></title>');
                      printWindow.document.write('</head ><body style="Font-              family:calibri;">');
                      printWindow.document.write(pageFooter);
                      printWindow.document.write(panel.innerHTML);
                      printWindow.print();
                      printWindow.document.write('</body></html>');

                      printWindow.document.close();
                      setTimeout(function () {
                          printWindow.print();
                      }, 500);
                      return false;
                  }
        </script>

pannel想要打印

                                                                                        页                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
    </div>

按钮单击如何在页脚中打印页面

点击客户端上的按钮             

请提出任何建议......

css我在我的代码中使用了

    @page {
    @bottom-right {
    content: "Page " counter(page) " of " counter(pages)
    }
}

0 个答案:

没有答案