Use this javascript :
<script language="javascript" type="text/javascript">
function Clickheretoprint() {
var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25";
var content_vlue = document.getElementById('<%=dvPrintXL.ClientID %>').innerHTML;
var docprint = window.open("", "", disp_setting);
docprint.document.open();
docprint.document.write('<html><head><title>Stock Statement</title>');
docprint.document.write('</head><body><center>');
docprint.document.write(content_vlue);
docprint.document.write('</center></body></html>');
docprint.print();
docprint.document.close();
docprint.focus();
}
</script>
//on .aspx page :
<a href="#" onclick="javascript:Clickheretoprint();">
<img alt="Print" src="../Images/print.gif" style="border: none" /></a>
//on .cs page :
public override void VerifyRenderingInServerForm(Control control)
{
}
Hope this will help you.
Don't forget to mark as answer if it helps. :)