Convert C# string to JavaScript String
Clash Royale CLAN TAG #URR8PPP Convert C# string to JavaScript String Does anybody know a way to convert a C# string to a JavaScript String in Asp.net. My code looks like this: <script> @{string thing = "Cats";} var thing = String(@thing); </script> </div> <body onload="eventAlert(thing)"></body> I think what you're looking for is a way to get a string value from server side (code behind) to client side (javascript). Is that right? – paqogomez Dec 19 '14 at 22:36 The eventAlert(thing) function simply shows the string as an alert, but the code above does nothing unless i manually pass in the string. – Sepehr Sobhani Dec 19 '14 at 22:38 ...