Solved

How to trigger print command in aspx and c#?

Posted on 2009-05-06
2
930 Views
Last Modified: 2013-12-17
Hi

I have a aspx page with table and list of data.

I want to print it out by clicking a button.

How should I write it in C#?
0
Comment
Question by:techques
2 Comments
 
LVL 13

Accepted Solution

by:
copyPasteGhost earned 25 total points
ID: 24314803
put this in your page_load

Page.RegisterStartupScript("myScript", "<script language=JavaScript>window.print();</script>");
0
 
LVL 12

Assisted Solution

by:GuitarRich
GuitarRich earned 25 total points
ID: 24314956
if you want to print it from a button do this
<asp:button id="button1" runat="server" OnClientClick="javascript:window.print();" text="Print Form"></asp.button>
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question