Looking to pass variables from c# to javascript to use some jquery code. Passing doubles, ints, strings, arrays. Does anyone know how to do this?
for example if I have this code snip in c#:
string blah = "this is a blah string";
I would like to pass this into javascript so that I could use a mouseover event in jquery:
$('#myDiv').mouseover(function(){ //do something with my 'blah' string });
Nevermind I think I figured it out. Assuming the code above, you can write in javascript:
<script type="text/javascript"> var JavascriptBlah = '<%=blah%>'</script>
This will pass the blah in c# to the JavascriptBlah on the client side. Then you can manipulate on client side.