
Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Important thing to understand is that browsers can print only the whole
> page. You can achieve printing part of the page by hiding controls you don't
[quoted text clipped - 6 lines]
> javascript code to check the Setting controls and to locate and hide
> controls in the printable part.
I didn't find any onbeforeprint and onafterprint events. Where can I
find some information on that?
I tried following:
function myPrint()
{
document.getElementById('<%= div1.ClientID %>').style.display = 'none';
window.print();
document.getElementById('<%= div1.ClientID %>').style.display = '';
}
Making the elements visible again happens too early. So the hidden part
gets displayed on the printed sheet. Any ideas how to solve that?
> You can also create a special stylesheet for printing like this:
> <link rel="stylesheet" type="text/css" media="print" href="print.css" />
>
> and manipulate with control css classes either or server or client side.
Eliyahu Goldin - 17 Oct 2007 13:09 GMT
Putting the code for making visible in onafterprint will solve your problem.
http://msdn2.microsoft.com/en-us/library/ms536788.aspx
http://msdn2.microsoft.com/en-us/library/ms536906.aspx

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
>> Important thing to understand is that browsers can print only the whole
>> page. You can achieve printing part of the page by hiding controls you
[quoted text clipped - 25 lines]
>>
>> and manipulate with control css classes either or server or client side.
Joe Kovac - 17 Oct 2007 14:08 GMT
Thanks. But how about FF?
> Putting the code for making visible in onafterprint will solve your problem.
>
> http://msdn2.microsoft.com/en-us/library/ms536788.aspx
> http://msdn2.microsoft.com/en-us/library/ms536906.aspx
Eliyahu Goldin - 17 Oct 2007 14:20 GMT
Right, they won't wok in FF. Research the css option.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> Thanks. But how about FF?
>
[quoted text clipped - 3 lines]
>> http://msdn2.microsoft.com/en-us/library/ms536788.aspx
>> http://msdn2.microsoft.com/en-us/library/ms536906.aspx
Joe Kovac - 19 Oct 2007 13:54 GMT
> Right, they won't wok in FF. Research the css option.
Thanks. The css option works great. I just hide what shall not be
printed using a "noprint" class.