You can pass the value from ASP.NET to javascript as follows:
In your code, create a property:
protected string MyValue { get { return "my value"; } }
In the markup, assign a value to the javascript variable:
<script>
var myValue = "<%= MyValue %>";
...
</script>
Now you can use this value in javascript.
source
share