Is it possible to do something like this:
<% Dim foo as string = "bar" %>
<script type="text/javascript">
var baz = <%=foo %>
</script>
Where the <script>
tag is embedded on my index page?
Is it possible to do something like this:
<% Dim foo as string = "bar" %>
<script type="text/javascript">
var baz = <%=foo %>
</script>
Where the <script>
tag is embedded on my index page?
Yes, but make sure you put quotes around it and a semicolon:
var baz = '<%=foo %>';