Link to home
Start Free TrialLog in
Avatar of KavyaVS
KavyaVS

asked on

How to make the Print button not appear on the printed page.

I have a print button on the aspx page.
<asp:ImageButton ID="btnPrint" ImageUrl="~/Images/Print2.gif" ToolTip="Print Page" runat="server" AlternateText="Print" />

In the Page Load event I added
btnPrint.Attributes.Add("onClick", "window.print();");

The problem here is when I click the print button I am able to print the page. But the printed page has print button on it.
How to make the Print button not appear on the printed page.

Thanks
SOLUTION
Avatar of bigbigpig
bigbigpig

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KavyaVS
KavyaVS

ASKER

I created print.css file added this line in aspx page.
<link rel="stylesheet" href="css/print.css" media="print" />

It is saying content is not supported outside script or content regions.
I am using content control and Master Page in my application.

Where can I put the print.css file.

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial