Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to get printed my textbox "text" through printer how can is plz suggest some code plzzzz
Posted

hi ,
if you can Surround your text box with Div this will be your solution .

XML
<script language="javascript" type="text/javascript">
                function CallPrint(strid) {
                    var prtContent = document.getElementById(strid);
                    var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
                    WinPrint.document.write(prtContent.innerHTML);
                    WinPrint.document.close();
                    WinPrint.focus();
                    WinPrint.print();
                    WinPrint.close();
                    prtContent.innerHTML = strOldOne;
                }
</script>

ASP.NET
<div id="bill">
<asp:textbox id="TextBox1" runat="server" textmode="MultiLine" height="224px" xmlns:asp="#unknown">
            style="margin-bottom: 136px" Width="320px"></asp:textbox>
</div>

ASP.NET
<asp:button id="BtnPrint" runat="server" text="Print" onclientclick="javascript:CallPrint('bill');"  />
</div>


Hope it help you
 
Share this answer
 
This thread[^] should help you.
This thread[^] too can be useful to you.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900