Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-12-2008
Member
 
Join Date: Dec 2008
Posts: 13
How to take Print out in ASP.NET

How can i take the print out of my asp.net page ?
I am not getting the code for it, if you have a code please help me.

Thanks.
Reply With Quote
  #2  
Old 27-12-2008
Member
 
Join Date: May 2008
Posts: 2,293
Re: How to take Print out in ASP.NET

You can do it directly by using below javascript function,

function formprint()
{
window.print();
}
Reply With Quote
  #3  
Old 27-12-2008
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: How to take Print out in ASP.NET

Use the Following Code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="PL_Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
@media print
{
.Hide
{
display:none;
}
}
</style>
</head>

<body>
<form id="form1" runat="server">
<div>

</div>

<asp:Button ID="btnBack" runat="server" Text="Back" style="left: 354px; position: relative; top: 166px" CssClass="Hide" />
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick="window.print();" style="left: 242px; position: relative; top: 165px"/>
</form>
</body>
</html>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to take Print out in ASP.NET"
Thread Thread Starter Forum Replies Last Post
Using current XP Print drivers and Windows 7 Print drivers on 2003 Print Server Richcom Operating Systems 3 28-07-2010 10:19 PM
Unable to Print or Print Preview from IE7 on Vista Home Premium Poppy Vista Help 8 09-11-2009 07:14 AM
How to cancel printing or to delete a print job that is stuck in the print queue in Windows XP Alan Morris [MSFT] Windows XP Support 6 30-05-2008 10:53 PM
Print spooler hangs when trying to print from a shared print Jisbomb Windows XP Support 3 27-07-2007 10:17 PM


All times are GMT +5.5. The time now is 01:13 AM.