What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 2678 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > ASP.NET > Print your DIV content in asp.net ...
Ranjeet_8

Print your DIV content in asp.net

 Code Snippet posted by: Ranjeet_8 | Posted on: 1/1/2013 | Category: ASP.NET Codes | Views: 629 | Status: [Member] | Points: 40 | Alert Moderator   


#Print your div content in asp.net.
Add this java script on your web page.

<script language="javascript" type="text/javascript">
function PrintDivContent(strid) {
var prtContent = document.getElementById(strid);
var WinPrint =
window.open('', '', 'letf=0,top=0,toolbar=0,sta­tus=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
}
</script>

Add below code on .ASPX page

<div id="AppPrint">
1. Your Print content here..!<br />
2. Your Print content here..!!<br />
3. Your Print content here..!!!
</div>
<br /> <br />
<asp:Button ID="btnPrint" Text="Print" OnClientClick="javascript:PrintDivContent('AppPrint');"
runat="Server" Width="94px" Height="30px" />

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 5:03:57 PM