Alligator tags(<% %>) inside js string?
<p>I am trying to redirect a page reading the url from the config file.</p>

<p>However, when  I try this:</p>

<pre><code>   &lt;script type="text/javascript"&gt;
&lt;%string redirectUrl = System.Web.Configuration.WebConfigurationManager.AppSettings["RedirectURL"];%&gt;
    window.parent.location.replace("&lt;%=redirectUrl%&gt;");
&lt;/script&gt;
</code></pre>

<p>the alligator tags &lt;% %> are Not being highlighted, and when I run I get the following error in the yellow screen:</p>

<pre><code>the controls collection cannot be modified because the control contains code blocks (i.e. &lt;% ... %&gt;).
</code></pre>

<p>What am I doing wrong??</p>

<p>Thanks!</p>

<p>Edit:</p>

<p>It does work if I just put the url straight into the code, as in </p>

<pre><code>window.parent.location.replace("http://theurl.com");
</code></pre>

<p>but I need to change this depending on other things, so I need it to be in the config :S</p>
