I Use:
protected void butSubmit_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "popup", "<script>CallPrint(divPrint);</script>",true);
}
to call javascript print function
function CallPrint(strid)
{
var headstr = "<html><head><title>Print Page</title></head><body>";
var footstr = "</body></html>";
var WinPrint = window.open('','','left=150,top=150,width=300,height=300,menubar=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(headstr + strid.innerHTML + footstr);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
}
but the problem is it not working properly. when i use alert after window.open in javascript it working but alert not working after WinPrint.document.write.
How to solve this problem? I want to print the contents inside div tag.