D
Diego F.
Hello. I'm trying to call a function that prints the content of a div
element. I had that javascript code working, but now I must put that code in
the server side, as it is called from another component.
The problem is that it can't find the div control. Don't know why. I paste
the code here:
That's in the aspx.vb file:
Response.Write("<script>")
Response.Write(" var prtContent = document.getElementById(divPrint);")
Response.Write("var WinPrint =
window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');")
Response.Write(" WinPrint.document.write(prtContent.innerHTML);")
Response.Write(" WinPrint.document.close();")
Response.Write(" WinPrint.focus();")
Response.Write(" WinPrint.print();")
Response.Write(" WinPrint.close();")
Response.Write(" prtContent.innerHTML=strOldOne;")
Response.Write("</script>")
In the aspx file there is the div control with a datagrid inside.
element. I had that javascript code working, but now I must put that code in
the server side, as it is called from another component.
The problem is that it can't find the div control. Don't know why. I paste
the code here:
That's in the aspx.vb file:
Response.Write("<script>")
Response.Write(" var prtContent = document.getElementById(divPrint);")
Response.Write("var WinPrint =
window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');")
Response.Write(" WinPrint.document.write(prtContent.innerHTML);")
Response.Write(" WinPrint.document.close();")
Response.Write(" WinPrint.focus();")
Response.Write(" WinPrint.print();")
Response.Write(" WinPrint.close();")
Response.Write(" prtContent.innerHTML=strOldOne;")
Response.Write("</script>")
In the aspx file there is the div control with a datagrid inside.