<%@ Page Language="C#" AutoEventWireup="true" CodeFile="print.aspx.cs" Inherits="view_print" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>打印</title> <mce:script type="text/javascript" language="javascript"><!-- function printsetup(){ // 打印页面设置 wb.execwb(8,1); } function printpreview(){ // 打印页面预览 wb.execwb(7,1); } function printit() { if (confirm('确定打印吗?')) { wb.execwb(6,6) } } function doPrint() { bdhtml=window.document.body.innerHTML; sprnstr="<!--startprint-->"; eprnstr="<!--endprint-->"; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window.print(); } // --></mce:script> <mce:style type="text/css"><!-- body{ padding: 0; margin: 0;font-size:12px} --></mce:style><style type="text/css" mce_bogus="1"> body{ padding: 0; margin: 0;font-size:12px} </style> </head> <body> <!--startprint--> <object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width="0"></object> <form id="form1" runat="server"> <table> <tr> <th> 订单编号:</th> <td> <asp:Label ID="labrc" runat="server"></asp:Label></td> </tr> <tr> <th> 商品名称:</th> <td> <asp:Label ID="labname" runat="server"></asp:Label></td> </tr> <tr> <th> 充值类型:</th> <td> <asp:Label ID="labsalemodel" runat="server"></asp:Label></td> </tr> <tr> <th> 卡号:</th> <td> <asp:Label ID="labcardno" runat="server"></asp:Label> </td> </tr> <tr> <th>密码:</th> <td><asp:Label ID="labpass" runat="server"></asp:Label></td> </tr> <tr> <th> 打印时间:</th> <td> <asp:Label ID="txtnopass" runat="server"></asp:Label></td> </tr> <tr> <th> 充值地址:</th> <td> <asp:Label ID="labaddress" runat="server"></asp:Label></td> </tr> </table> <input id="close" value="关闭本页" class="greybtn1" type="button" οnclick="window.close();"; /> <input id="print" value="打印" class="greybtn1" type="button" οnclick="doPrint();"; /> </form> <!--endprint--> </body> </html>