<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="../../../Oimec/Script/jquery-3.2.1.js"></script>
    <script src="../../../Oimec/Script/jquery-3.2.1.min.js"></script>
    <title></title>
</head>
<%--<body style="height: 200px; width: 100px" onload='setTimeout("wprint()",3000)'>--%>
<body onload='setTimeout("wprint()",100)' id="body">
    <form id="form1" runat="server">
        <div id="div_connect">
        </div>
    </form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        var print_html = self.opener.document.getElementById('div_print').innerHTML; //获取父窗体内容
        $("#div_connect").html(print_html);
        var print_html1 = $("#div_connect").html();

        //if (print_html1 != null && print_html1 != undefined && print_html1 != "") {

        //} else {
        //    //var print_html2 = self.opener.document.getElementById('div_print').innerHTML;
        //    //$("#div_connect").html(print_html2);

        //}

    })

    function wprint() {
        var print_html1 = $("#div_connect").html();
        if (print_html1 != null && print_html1 != undefined && print_html1 != "") {
            $("#body").html(print_html1);
            window.print();
            window.close();
        } else {
            var print_html2 = self.opener.document.getElementById('div_print').innerHTML;
            $("#div_connect").html(print_html2);
            $("#body").html(print_html2);
            window.print();
            window.close();
        }
    }
</script>
