Javascript error : object required
<p>I am calling a javascript function in a button in aspx page  like </p>

<pre><code>OnClientClick= "printText(document.getElementById('PrintPayslipPart').innerHTML)"
</code></pre>

<p>and function is;</p>

<pre><code>function printText(elem)
     { 
        PrintPaySlip = window.open('RP_PrintPaySlip.html','PrintPaySlip','toolbar=no,menubar=yes,width=1000, Height = 700, resizable=yes,scrollbar=Yes'); 
        PrintPaySlip.document.open(); 
        PrintPaySlip.document.write("&lt;html&gt;&lt;head&gt;");
        PrintPaySlip.document.write("&lt;/head&gt;&lt;body onload='print()'&gt;"); 
        PrintPaySlip.document.write(elem); 
        PrintPaySlip.document.write("&lt;/body&gt;&lt;/html&gt;"); 
        PrintPaySlip.document.close();
    } 
</code></pre>

<p>I am using <code>.net 3.5</code> and <code>ajaxcontrolltoolkit 3.5.40412.2</code></p>

<p>When clicking on button the error shows as "Microsoft JScript runtime error: Object required".</p>
