Click here to Skip to main content
15,845,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai, How can I print a purticular area(Panel1) of my webpage?can you help me
Posted

1 solution

XML
<script type="text/javascript" language="javascript">
    function printdiv()
    {
    var divToPrint=document.getElementById('<%=PanelId.ClientID %>');
    var newWin=window.open('AdminInvestments.aspx','PrintWindow');
    newWin.document.open();
    newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');
    newWin.document.close();
    setTimeout(function(){newWin.close();},10);
    }



call this javascript function in which button click you want ...like below

<a href="#" önclick="javascript:printdiv();" style="color:Blue">Print</a>
 
Share this answer
 
v3
Comments
P.Salini 17-Sep-11 3:22am    
My 5!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900