c# - How can i print (on new window) two specific panel ID -
i want open new window , contain both panel print as...
hi, how u? fine..!!
i use script print in head part
<head> <scripttype="text/javascript"> functionprintpanel() { var panel = document.getelementbyid("<%=pa1.clientid%>"); varprintwindow = window.open('', '', 'height=400,width=800'); printwindow.document.write('<html><head><title>div contents</title>'); printwindow.document.write('</head><body >'); printwindow.document.write(panel.innerhtml); printwindow.document.write('</body></html>'); printwindow.document.close(); settimeout(function () { printwindow.print(); }, 500); returnfalse; } </script> </head>
in body part have
<body> <asp:imagebuttonid="print_btn"runat="server" imageurl="~/images/awards2.jpg"onclientclick="return printpanel();"height="50"width="50"/> <asp:panel id="pa1" runat="server">hi, how u?</asp:panel> <asp:panel id="pa2" runat="server">i fine..!!</asp:panel> </body>
through "hi, how u?" print, want "hi, how u? fine..!!".....
because rendered div you'll need put break in between them. this:
<asp:panel id="pa1" runat="server">hi, how u?</asp:panel> <br /> <asp:panel id="pa2" runat="server">i fine..!!</asp:panel>
to print page when loads this:
<body onload="javascript:windows.print();">
Comments
Post a Comment