文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>ASP.NET打印功能實現

ASP.NET打印功能實現

时间:2010-09-13  来源:Aliceblogs

<head runat="server">
    <title>无标题页</title>
   <script language="Javascript" type="text/javascript">
                function preview()
                 {
                 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();
                 }
                </script>

</head>
<body>
    <form id="form1" runat="server">
                <center>本部分以上不被打印</center>
                <!--startprint-->
    <div align="center">
        <asp:GridView ID="GridView1" runat="server"></asp:GridView>
    </div>
     <!--endprint-->
                <center>本部分以下不被打印</center>  
 <div align="center">
               <input type="button" name="print" value="打印" onclick="preview()"/>
                </div>
                sdfsfsdfsdfsdfsdfsdf
                sdfsdfsdfsdfsdfsdfsd
                sfsfsdfsd
                <input class="Noprn" type="button" onclick="window.print()" value="print"/>

    </form>
</body>
</html>

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载