Executing C# code on first page load
<p>I have a public static method <code>string SomeMethod(string message)</code> inside a <code>SomeClass</code> class which gets a string as input and returns something like</p>

<pre><code>&lt;div&gt;message&lt;/div&gt;
</code></pre>

<p>Of course this is over-simplificated, but the idea is just like this. Now I would like to do something like</p>

<pre><code>&lt;script language="javascript"&gt;var string = &lt;% $SomeClass.SomeMethod('asdada');&gt;&lt;/script&gt;
</code></pre>

<p>the first time the page is loaded, but I don't really know how can I do it. That just gives me an "object expected" error in JavaScript. Can anyone please help me out with this?</p>
