Boring javascript calling: why a non-desirable js function has been called?
<p>I'm building an aspx page with a button that calls another page in a different window, through javascript:</p>

<pre><code>function assuntos() {
        window.open("pg_assuntos.aspx", "List", "scrollbars=no,resizable=no,width=600,height=480");
    }
</code></pre>

<p>in the page's Onload event, I have the code:</p>

<pre><code>bot_cadastrar.Attributes.Add("onclick", "assuntos()")
</code></pre>

<p>When I click the button, all gonna be right. But everytime I update a fild that execute a query, the "onclick" event seems to be raised or function seems to be executed, because the window is opened. I also have another code in the onload event for starting a stopwatch javascript function:</p>

<p>VB CODE:</p>

<pre><code>Dim script = "&lt;script language = javascript&gt;" &amp; _
                   "window.setTimeout('ShowTime()', 1000);&lt;/script&gt;"

ClientScript.RegisterStartupScript(Me.GetType, "iniciar", script)
</code></pre>

<p>ASPX CODE (javascript):</p>

<pre><code>function ShowTime() {
    var dt = new Date();
    var dif = dt - dtIn;
    var tim = new Date();
    tim.setHours(0, 0, 0, dif);
    document.getElementById("&lt;%= cmp_hora.ClientID %&gt;").value = dt.toLocaleTimeString();
    document.getElementById("&lt;%= cmp_tempo.ClientID %&gt;").value = tim.toLocaleTimeString();
    window.setTimeout("ShowTime()", 1000);
}
</code></pre>

<p>Why the function is starting for itself? I'm fed up whith these popups!</p>
