Results 1 to 3 of 3

Thread: How to take Print out in ASP.NET

  1. #1
    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.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: How to take Print out in ASP.NET

    You can do it directly by using below javascript function,

    function formprint()
    {
    window.print();
    }

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    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>

Similar Threads

  1. Replies: 3
    Last Post: 28-07-2010, 10:19 PM
  2. Replies: 8
    Last Post: 09-11-2009, 07:14 AM
  3. Replies: 6
    Last Post: 30-05-2008, 10:53 PM
  4. Print spooler hangs when trying to print from a shared print
    By Jisbomb in forum Windows XP Support
    Replies: 3
    Last Post: 27-07-2007, 10:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,384,465.27134 seconds with 16 queries