Window.print() fails to print
<p>For printing my Aspx web page I use following code but in IE I encounter "Stack over flow at line:0"  error message and in fire fox any thing doesn't happen.
what's wrong?</p>

<pre><code>&lt;head&gt;
 &lt;script language="javascript" type="text/javascript"&gt;
        function print() {
            window.print();
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
&lt;div class="toolbar" style="width:400px"&gt;
            &lt;ul&gt;
&lt;li&gt;
                &lt;img alt="" src="../../../CssImages/printer_128.png" id="ImgPrint" width="20px" style="cursor:pointer" onclick="print()"/&gt;
                &lt;/li&gt;
     &lt;/ul&gt;
</code></pre>
