Wednesday, January 9, 2013

Print a Web Page using JavaScript


Add the below JavaScript code between your page header tags.

<script type="text/javascript">
function printing() {
window.print();
}
</script>

Add a button which calls the printing() function.

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="printing(); return false;" />

No comments:
Write comments
Recommended Posts × +