I have an ASP.net page where I am trying print the page directly from a
printer. The only way I can figure out how to do this is in Javascript with
PrintDomTree.
The problem is that I don't get anything back when using a getElementByID.
It is null. The ID is there.
Here is the javascript:
****************************
function printDOMTree(destinationWindow)
{
// Use destination window to print the tree. If destinationWIndow is
// not specified, create a new window and print the tree into that
window
alert("Inside printDOMTree");
var domElement = document.getElementById('MainTable');
if (domElement == null)
alert("domElement == null");
else
alert ("domElement != null");
************************************************
I get the alert back that says domElement is null.
Here is the tag:
<DIV ID="MainTable">
And you can see it when you viewsource.
What am I missing?
Thanks,
Tom