Solved

How to trigger print command in aspx and c#?

Posted on 2009-05-06
2
926 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now