Script tag in ASPX page is not written
<p>I have an aspx page with the following code (partial and simplified):</p>

<pre><code>(beginning of page)
&lt;body id="body" runat="server"&gt;
&lt;form id="form1" runat="server"&gt;some HTML&lt;/form&gt;
    &lt;script type="text/javascript"&gt;
         window.addEvent('domready', function() { 
           var x = "nothing";
           &lt;% if(someCondition){%&gt;
           x = "2";
           &lt;%} else {%&gt;
           x = "3";
           &lt;%}%&gt;
          });
    &lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p>Now, the thing is that this script sometime appears in the output, and sometimes not.<br>
It's not conditional, and supposed to be written every time the page is rendered. Why does it do that?</p>

<p>I'd be happy to get your help.
Thanks!</p>
