How can I register a C# variable value to a Javascript variable every time an event is fired
<p>I have an event handler in C# code-behind for an .aspx page.  Each time this event handler fires I want it to update a Javascript variable.  I thought I could do something like this.</p>

<pre><code>int scale = (int)myObject.Scale;
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "JSVariables", "scale=" + scale, true);
</code></pre>

<p>However, as it was pointed out to me earlier <a href="http://stackoverflow.com/questions/644874/why-does-this-javascript-variable-im-creating-via-c-only-get-updated-once">here</a>, RegisterClientScript checks first to see whether or not the script has been registered and if it has it does nothing.  In essence the variable is updated once then never again.</p>

<p>Is it possible to have this value continuously updated?</p>

<p>The most I can really do with Ajax is to have a static web method.  For a couple of reasons that are unnecessary to explain here I can't use a WCF or web service, and the problem with the static web method is the static bit.  </p>

<p>Is there any other way?</p>

<p>I was thinking maybe some session trickery but I'm not sure yet.</p>
