Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

is there a code to print an asp.net pagem or some text in inside it ?

thank you : )
Posted

Printing a web page -- any web page -- is handled by the browser. It cannot be done server-side, so there are no C# or .Net methods available for doing this.

There are methods in Javascript and other browser-side scripting tools that will allow your user to print. These cause the browser to display a "select printer" dialog and cannot be used to automatically print a page without the user's intervention.
 
Share this answer
 
you can do it with a button:
XML
<asp:button id="printButton" runat="server" text="Print" onclientclick="javascript:window.print();" xmlns:asp="#unknown" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900