RegisterStartupScript and multiple controls
<p>I have a parentUserControl that loads a childUserControl. Multiple instances (say 3) of parentUserControl is added to the host page.</p>

<p>On PageLoad of the parentUserControl, I register JS:</p>

<pre><code>ScriptManager.RegisterStartupScript(this, typeof(Page), keyJSLoadBegin, "OnParentLoad();", true);
</code></pre>

<p>On PageLoad of hte childUserControl, I register JS:</p>

<pre><code>ScriptManager.RegisterStartupScript(this, typeof(Page), keyJSLoadBegin, "OnChildLoad();", true);
</code></pre>

<p>I get a JS error when I navigate to the page. The line that causes this error is (in View Source):</p>

<pre><code>`OnParentLoad('parentA');OnChildLoad('childA');OnParentLoad('parentB');
OnParentLoad('parentC')`;OnChildLoad('childC');OnChildLoad('childB')
</code></pre>

<p>Clearly, the calls are out of order. </p>

<p>Anyone knows why?</p>

<p><strong>EDIT:</strong></p>

<p>The problem seems to be related to the bug here:
<a href="http://support.microsoft.com/kb/817032" rel="nofollow">http://support.microsoft.com/kb/817032</a></p>

<p>The suggestion is to register all related scripts at once. This is impossible in my situation as the scripts are in different user controls.</p>

<p>Has anyone come across a solution to this issue?</p>
