Click here to Skip to main content
11,642,233 members (64,285 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi,

Can anybody solve my problem

How to get only data not with controls while printing a web page(.aspx) using printer.

for example a text box containing data sangeetha
when i press the print button the text box will disappear only data i.e, sangeetha should print.

Please help me out this.


Regards,
Sangeetha.
Posted 29-Aug-12 1:33am
Comments
Wes Aday at 29-Aug-12 7:51am
   
This is really unclear. If you only want "sangeetha" then only print that. What makes you think that the text box will print? What do enabling controls on your page have to do with anything? Why would you need the textbox to magically disappear when the print button is pressed?
Marcus Kramer at 29-Aug-12 9:46am
   
Please remove your email from your username, unless you like to receive lots of spam.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

1. Common way: Create completely new page that will contain only labels with the data you need printed. Format the page however you see fit. Add a button that will have @media print style display: none; The button should call javascript function window.print();

2. If you want to keep your page without having to create another: create CSS sheet with printing styles in which your text boxes and other controls have "border: none" and background-color = whatever your background color is (or set it to transparent) - that way only the data will be visible when printing.


If you want to know more google for "media dependant CSS".

If this helps please take time to accept the solution.
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 19 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100