Hello,all. I success to use the window.print() to print my web form, but the print button will print out together.. Any expertise knows how to hide the button while printing??
I'm using ASP.NET and VB.NET, database use MySQL. Hope u can help me, thank you.
CSS is a client side, hence it has nothing to do with ASP.NET and/or VB.NET and is used to layout your rendered html. You can take a look at
http://www.w3schools.com/css/. If you want to see what's possible with CSS you can take a look at
http://www.csszengarden.com/.
Grz, Kris.
Read my blog | Twitter Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
kumiko
Member
75 Points
15 Posts
Hide the button when printing
Jun 16, 2006 07:28 AM|LINK
Hello,all. I success to use the window.print() to print my web form, but the print button will print out together.. Any expertise knows how to hide the button while printing??
I'm using ASP.NET and VB.NET, database use MySQL. Hope u can help me, thank you.
XIII
All-Star
182702 Points
23463 Posts
ASPInsiders
Moderator
MVP
Re: Hide the button when printing
Jun 16, 2006 07:30 AM|LINK
Hi,
you can use CSS for this purpose. Please read the following article: Going to print.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
kumiko
Member
75 Points
15 Posts
Re: Hide the button when printing
Jun 16, 2006 08:54 AM|LINK
XIII
All-Star
182702 Points
23463 Posts
ASPInsiders
Moderator
MVP
Re: Hide the button when printing
Jun 16, 2006 09:49 AM|LINK
Hi,
CSS is a client side, hence it has nothing to do with ASP.NET and/or VB.NET and is used to layout your rendered html. You can take a look at http://www.w3schools.com/css/. If you want to see what's possible with CSS you can take a look at http://www.csszengarden.com/.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
firoz.ansari
Contributor
3515 Points
694 Posts
Re: Hide the button when printing
Jun 17, 2006 08:27 AM|LINK
Here is the small code snippet:
<span class="hide_print">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 24px" runat="server" Text="Button"></asp:Button></form>
</span>
<HEAD>
<title>WebForm2</title>
<style media=print>
.hide_print {display: none;}
</style>
</HEAD>
If you take print out of this page, button Button1 will be hide. I hope this help.
kumiko
Member
75 Points
15 Posts
Re: Hide the button when printing
Jun 19, 2006 06:30 AM|LINK
YeaH, thanks a lot firoz.ansari, the code is wonderful, I success to hide the button alr!!!
Thanks to firoz ansari and XIII ! Thanks ur help! [:D]
McGuire
Member
67 Points
161 Posts
Re: Hide the button when printing
Feb 25, 2009 04:35 PM|LINK
firox.ansari,
Your code works great. Wish I could give you some points for this!!!
J.R.R. Tolkien