I have a public static method string SomeMethod(string message) inside a SomeClass class which gets a string as input and returns something like
<div>message</div>
Of course this is over-simplificated, but the idea is just like this. Now I would like to do something like
<script language="javascript">var string = <% $SomeClass.SomeMethod('asdada');></script>
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?
If you want your server side tags to output something, you should use:
Your code, invokes the method, but does not send the output to the page:
And, if this is a serverside class, why do you include the
$sign?