This question already has answers here:
Closed 7 years ago.
Possible Duplicate:
How to assign JavaScript value under MVC3
I try to do the following
<script type="text/javascript">
var techIDs = "";
@if (ViewBag.URLParameters != null)
{
techIDs = '@ViewBag.URLParameters';
}
</script>
But it seems it's a wrong approach.
Any clue how it could be done?
Thank you!