Printing in ASP.NET

Submitted by: 
Visitors have accessed this post 5347 times.

In windows desktop application it is easy to print a form data for report or other purpose but in web form it is not easy to print a page.
The printing on client side needs solutions for different conditions
using JavaScript

The simplest way to print a web form is to use client side JavaScript. To print a web page, you can use code like this:

  1. <input type="button" value="Print" onclick="window.print();">

this will print whole page including print button and this can be useful in some case.For making it more professional you can make two version of web page one for the scree and another for the printing purpose. result will be that your print button will open print version in another window and call windows.print() method when page loads

About the author: is a place for all developer providing free source codes, articles, complete projects,complete application in PHP, C/C++, Javascript, Visual Basic, Cobol, Pascal, ASP/VBScript, AJAX, SQL, Perl, Python, Ruby, Mobile Development


currently i am using and i want to print my data or records in HTML report. So, what i do? please help me.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe>
  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.