js网页打印

<%@ Page language="c#" Codebehind="ZYXX.aspx.cs" AutoEventWireup="false" Inherits="CUST_ZSLQ.zsb.ZYXX" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
 <HEAD>
  <title>ZYXX</title>
  <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
  <meta name="CODE_LANGUAGE" Content="C#">
  <meta name="vs_defaultClientScript" content="JavaScript">
  <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  <script language="javascript">
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();
location.href="ZY.aspx"
}
  </script>
  <style>
  .Noprint { DISPLAY: none }
  </style>
 </HEAD>
 <body MS_POSITIONING="GridLayout">
  <form id="Form1" method="post" runat="server">
   <!--startprint-->
   <FONT face="宋体">
    <asp:Label id="Label3" style="Z-INDEX: 123; LEFT: 120px; POSITION: absolute; TOP: 56px" runat="server"
     Width="56px">第一联</asp:Label>
    <asp:Label id="Label15" style="Z-INDEX: 133; LEFT: 632px; POSITION: absolute; TOP: 136px" runat="server"
     Width="32px" Font-Size="Large">No.</asp:Label>
    <asp:Label id="lblNo2" style="Z-INDEX: 132; LEFT: 704px; POSITION: absolute; TOP: 136px" runat="server"
     Width="192px" Height="32px" Font-Size="Large">Label</asp:Label>
    <asp:Label id="Label12" style="Z-INDEX: 130; LEFT: 128px; POSITION: absolute; TOP: 120px" runat="server"
     Width="32px" Font-Size="Large">No.</asp:Label>
    <asp:Label id="lblNo" style="Z-INDEX: 129; LEFT: 128px; POSITION: absolute; TOP: 120px" runat="server"
     Width="32px" Font-Size="Large">No.</asp:Label>
    <asp:Panel id="Panel1" style="Z-INDEX: 125; LEFT: 520px; POSITION: absolute; TOP: 24px" runat="server"
     Width="1px" Height="600px" BackColor="Gray" HorizontalAlign="Left"><BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR>.<BR></asp:Panel>
    <asp:Label id="Label1" style="Z-INDEX: 100; LEFT: 120px; POSITION: absolute; TOP: 168px" runat="server"
     Width="48px" Font-Size="Large">省份</asp:Label>
    <asp:Label id="Label9" style="Z-INDEX: 124; LEFT: 624px; POSITION: absolute; TOP: 56px" runat="server"
     Width="56px">第二联</asp:Label>
    <asp:Label id="lblBZ0" style="Z-INDEX: 122; LEFT: 704px; POSITION: absolute; TOP: 408px" runat="server"
     Font-Size="Large"></asp:Label>
    <asp:Label id="lblZY0" style="Z-INDEX: 121; LEFT: 704px; POSITION: absolute; TOP: 312px" runat="server"
     Font-Size="Large" Width="292px">光电信息工程</asp:Label>
    <asp:Label id="lblXM0" style="Z-INDEX: 120; LEFT: 704px; POSITION: absolute; TOP: 256px" runat="server"
     Width="212px" Font-Size="Large">姓名</asp:Label>
    <asp:Label id="lblKSH0" style="Z-INDEX: 119; LEFT: 704px; POSITION: absolute; TOP: 192px" runat="server"
     Font-Size="Large">11223344556677</asp:Label>
    <asp:Label id="lblKSH" style="Z-INDEX: 115; LEFT: 192px; POSITION: absolute; TOP: 208px" runat="server"
     Font-Size="Large">11223344556677</asp:Label>
    <asp:Label id="Label14" style="Z-INDEX: 113; LEFT: 632px; POSITION: absolute; TOP: 408px" runat="server"
     Font-Size="Large">备注</asp:Label>
    <asp:Label id="lblZY2" style="Z-INDEX: 112; LEFT: 632px; POSITION: absolute; TOP: 312px" runat="server"
     Font-Size="Large">专业</asp:Label>
    <asp:Label id="lblXM2" style="Z-INDEX: 111; LEFT: 632px; POSITION: absolute; TOP: 256px" runat="server"
     Font-Size="Large">姓名</asp:Label>
    <asp:Label id="Label11" style="Z-INDEX: 110; LEFT: 608px; POSITION: absolute; TOP: 192px" runat="server"
     Font-Size="Large">考生号</asp:Label>
    <asp:Label id="lblZY" style="Z-INDEX: 106; LEFT: 184px; POSITION: absolute; TOP: 432px" runat="server"
     Font-Size="Large" Width="290px">光电信息工程</asp:Label>
    <asp:Label id="lblBZ" style="Z-INDEX: 108; LEFT: 192px; POSITION: absolute; TOP: 496px" runat="server"
     Font-Size="Large" Width="216px">A B C D E F G H</asp:Label>
    <asp:Label id="Label8" style="Z-INDEX: 103; LEFT: 120px; POSITION: absolute; TOP: 248px" runat="server"
     Font-Size="Large">姓名</asp:Label>
    <asp:Label id="Label2" style="Z-INDEX: 101; LEFT: 96px; POSITION: absolute; TOP: 208px" runat="server"
     Font-Size="Large">考生号</asp:Label>
    <asp:Label id="lblXM" style="Z-INDEX: 102; LEFT: 192px; POSITION: absolute; TOP: 248px" runat="server"
     Width="256px" Font-Size="Large">姓名</asp:Label>
    <asp:Label id="Label4" style="Z-INDEX: 104; LEFT: 120px; POSITION: absolute; TOP: 328px" runat="server"
     Font-Size="Large">分数</asp:Label>
    <asp:Label id="Label5" style="Z-INDEX: 105; LEFT: 120px; POSITION: absolute; TOP: 288px" runat="server"
     Font-Size="Large">批次</asp:Label>
    <asp:Label id="Label6" style="Z-INDEX: 107; LEFT: 112px; POSITION: absolute; TOP: 432px" runat="server"
     Font-Size="Large">专业2</asp:Label>
    <asp:Label id="Label7" style="Z-INDEX: 109; LEFT: 120px; POSITION: absolute; TOP: 496px" runat="server"
     Font-Size="Large">备注</asp:Label>
    <br>
    &nbsp;
    <asp:Label id="lblSF" style="Z-INDEX: 116; LEFT: 192px; POSITION: absolute; TOP: 168px" runat="server"
     Width="152px" Font-Size="Large">吉林</asp:Label>
    <asp:Label id="lblPC" style="Z-INDEX: 117; LEFT: 192px; POSITION: absolute; TOP: 288px" runat="server"
     Font-Size="Large" Width="208px">第一批本科理</asp:Label>
    <asp:Label id="lblFS" style="Z-INDEX: 118; LEFT: 192px; POSITION: absolute; TOP: 328px" runat="server"
     Font-Size="Large" Width="160px">556</asp:Label>
    <asp:Label id="Label10" style="Z-INDEX: 126; LEFT: 112px; POSITION: absolute; TOP: 368px" runat="server"
     Font-Size="Large">专业1</asp:Label>
    <asp:Label id="lblZY1" style="Z-INDEX: 127; LEFT: 192px; POSITION: absolute; TOP: 368px" runat="server"
     Width="280px" Font-Size="Large">Label</asp:Label>
    <!--endprint-->
    <input type="button" name="button" value="打   印" onClick="doPrint()" style="Z-INDEX: 114; LEFT: 32px; POSITION: absolute; TOP: 16px"></FONT>&nbsp;
   <asp:Label id="lblNo1" style="Z-INDEX: 128; LEFT: 192px; POSITION: absolute; TOP: 120px" runat="server"
    Width="192px" Height="32px" Font-Size="Large">Label</asp:Label>
  </form>
 </body>
</HTML>

posted @ 2014-04-26 14:41  -琥珀川-  阅读(132)  评论(0编辑  收藏  举报