How can I inject a piece of VB.NET code in to an ASPX page and have it execute?
<p>The following piece of code executes as expected when placed in a user control or ASPX page.</p>

<pre><code>&lt;script type="text/javascript"&gt;

    (function() {

        if (someCondition) {            
            if (&lt;%=MyObject.IsActiveSession.ToString().ToLower() %&gt;) {
            &lt;% If (MyObject.IsLoggedIn) Then %&gt;
                // Do some fancy stuff
            &lt;% End If %&gt;
            } 
        }
    })();
&lt;/script&gt;
</code></pre>

<p>It renders as you would expect when the page executes.</p>

<p>Is there any way I can inject this code in the page dynamically and have it execute? </p>

<p>I tried using a Literal Web Control and surprise surprise, it output the code literally :)</p>
