Please refer this link
Print ASP.Net Panel contents in ASP.Net using C# VB.Net and JavaScript
Here I have added some div tag and i am hiding Div one content.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
<script type="text/javascript">
function PrintPanel() {
document.getElementById('Div1').style.display = "none";
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 500);
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Panel ID="pnlContents" runat="server">
<span style="font-size: 10pt; font-weight: bold; font-family: Arial">Hello,
<br />
This is <span style="color: #18B5F0">Mudassar Khan</span>.<br />
Hoping that you are enjoying my articles!</span>
<div id="Div1">
This is Div one content.
</div>
<div id="Div2">
This is Div two content.
</div>
</asp:Panel>
<br />
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick="return PrintPanel();" />
</form>
</body>
</html>
All Div tag will be shown in the web page. When you print the Panel the Div1 tag will not be printed.