Javascript update problem. ASP.net UpdatePanel
<p>I have some Javascript that I'm writing out to a literal control inside an UpdatePanel.  I've set it to alert the current time every 15 seconds but I always get the original time.  When I use Firebug I can see that the Script is getting updated.  Is this because its a partial page refresh?  How can I stop this happening.  I've added the OutputCache directive to try and stop caching to see if that was the problem but that hasn't made any difference.</p>

<p>Here's code sample. Front End:</p>

<pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
&lt;/asp:ScriptManager&gt;
&lt;asp:UpdatePanel ID="updTest" runat="server" UpdateMode="Always"&gt;
    &lt;ContentTemplate&gt;
        &lt;script type="text/javascript"&gt;
            function initScript(){
            &lt;asp:literal id="litUpdateScript" runat="server" /&gt;
            }
        &lt;/script&gt;
    &lt;/ContentTemplate&gt;
    &lt;Triggers&gt;
        &lt;asp:AsyncPostBackTrigger EventName="Tick" ControlID="panelRefresh" /&gt;
    &lt;/Triggers&gt;
&lt;/asp:UpdatePanel&gt;
&lt;asp:Timer ID="panelRefresh" Interval="15000" runat="server"&gt;&lt;/asp:Timer&gt;
</code></pre>

<p>Code Behind:</p>

<pre><code>Protected Sub panelRefresh_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles panelRefresh.Tick
    Me.litUpdateScript.Text = "alert('" &amp; Now.ToString() &amp; "');"
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Me.litUpdateScript.Text = "alert('" &amp; Now.ToString() &amp; "');"
    Dim script As String = "initScript();"
    ScriptManager.RegisterStartupScript(updTest, updTest.GetType(), "Myscript", script, True)
End Sub
</code></pre>

<p>This Causes the Correct time on page load but doesn't change on timer refreshes.  Although I can see the script changing in firebug.</p>
