I am trying to print the contents of whatever is inside the div. I did that successfully, but the contents that needs to be printed comes in a popup window.
Is it possible to see the conetents that need to be printed in a new tab. Below is the javascript code to do the printing:
any help will be appreciated.
<script type="text/javascript" >
function printdiv(printpage) {
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
document.getElementById('<%=lblDateTime.ClientID %>').style.display = "block";
document.getElementById('<%=lblDateTime.ClientID %>').innerHTML = new Date().toLocaleString();
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr + newstr + footstr;
w = window.open("", "_blank", "k").focus();
w.document.write(headstr + newstr + footstr);
w.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
<div id="div_print">
this contenet needs to be printed in a new tab rather than a pop up window
</div>
any help will be highly apprecaited