Skip Navigation Links
More In Javascript
 Generating Sequence Number-Serial Number-Row Number in DataGrid GridView...
 Fixed gridview/datagrid header while scrolling Asp.Net...
 Hiding Gridview column while printing...
 Creating Backup, Compress and FTP Sql Server Database...

Print particular area of page in Asp.Net

Many times in our Asp.net web applications we require some areas of the page
 not to get printed while taking their print from the browser. Their are various different
 ways to do so but i will describe the simplest and the efficient way to achieve the same functionality.

In the header section of aspx page write the following code :

 <style type="text/css">
         @media Print
         {
             .noprint
             {
                 DISPLAY: none
             }
         }
 </style>

YOu can also use the above code with Asp.net 2.0 master files.

Now just use the "noprint" class with the controls that you dont want to get printed

Example:
 


<table>

 <tr>

  <td>

   ........................ 

  </td>

 <tr>

 <tr class="noprint">

  <td>

   This row will be get printed 

  </td>

 <tr>

</table>

 

In the above example the second tablerow won't get printed.