title: ResolveClientUrl inside runat server head
body: <p>I'm working on a web form site. The head tag has the runat server attr. in the master page.</p>
  
  <p>I'm trying to use ResolveClientUrl for a .js file like this:</p>
  
  <pre><code> &lt;head runat="server"&gt;
     .. 
    &lt;script src='&lt;%= ResolveClientUrl("~/myscript.js") %&gt;' type="text/javascript" &gt;    &lt;/script&gt;
   &lt;/head&gt;
  </code></pre>
  
  <p>But then, I got an error:</p>
  
  <pre><code>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;). 
  </code></pre>
  
  <p>I found out that the problem was the runat server, so I removed it from the head tag... and now I'm getting the following error:</p>
  
  <pre><code>Using themed css files requires a header control on the page. (e.g. &lt;head runat="server" /&gt;). 
  </code></pre>
  
  <p>So, how can I use the ResolveClientUrl inside a runat server head?</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>I've added the script using an include at the master page's top (seems to work fine).. but there might be a better solution.</p>
  
  <pre><code>&lt;!-- #include file="myscript.js" --&gt;
  </code></pre>