Remove the default browser header and footer while printing aspx page.

Posted by Rajkatie under ASP.NET on 6/25/2012 | Points: 10 | Views : 4666 | Status : [Member] [MVP] | Replies : 4
I have successfully take print out asp.net page with some text box and lable control. but it also print following things in header and footer.

Web site from where the page was printed (e.g http://localhost/someSite/temp.aspx)
Page count
Title of the web page
Date of printing

So, I want to remove above things from printed page.

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)



Responses

Posted by: Gaur1982 on: 6/25/2012 [Member] Starter | Points: 25

Up
0
Down
That setting is configured by the user in their browser. Their is no way to disable it from code. You're best bet is to include instructions on how to configure/disable the settings.

See an example here: http://www.xheo.com/products/sps/default.aspx?print=true


Gaurav Agrawal
http://www.planetofcoders.com/

Rajkatie, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnbhatt on: 6/26/2012 [Member] Starter | Points: 25

Up
0
Down
This setting can not be controlled by Application. This is user setting. However, If you want to change in your System or Users System directly, follow below steps to do so.
Go to File Menu and Choose Print Preview > Then There is a Setting Icon in Left side, Click on it, you will have options for what to Print and What not, Select and Apply controls.

Hope this post will answer your query.

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Rajkatie, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnbhatt on: 7/5/2012 [Member] Starter | Points: 25

Up
0
Down
Dear Rajesh,

Hope you got satisfactory answer as your question can not be solved. Please mark as answer and close forum thread.

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Rajkatie, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Longwest on: 7/9/2015 [Member] Starter | Points: 25

Up
0
Down
You can have a look at:
http://www.codeproject.com/Articles/13795/Creating-print-preview-page-dynamically-in-ASP-NET

Best regards.
http://www.keepdynamic.com/

Rajkatie, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response