Link javascript file dynamically in asp.net
<p>I want to link to a javascript file in header dynamically</p>

<pre><code>&lt;script src='&lt;%=Global.RootPath%&gt;js/jquery1.4.2.js' type="text/javascript"&gt;&lt;/script&gt;
&lt;script src='&lt;%=Global.RootPath%&gt;js/jquery.mousewheel-3.0.4.pack.js' type="text/javascript"&gt;&lt;/script&gt;
</code></pre>

<p>but I got an error</p>

<blockquote>
  <p>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %>).</p>
  
  <p>Description: An unhandled exception occurred during the execution of
  the current web request. Please review the stack trace for more
  information about the error and where it originated in the code.</p>
  
  <p>Exception Details: <code>System.Web.HttpException: The Controls collection
  cannot be modified because the control contains code blocks (i.e. &lt;%
  ... %&gt;).</code></p>
</blockquote>

<p>I want to add javascript file dynamically. Please explain why I am getting this error and is there any other method to do this?</p>
