Having trouble embedding c# code inside a javascript block with MVC3 RC1 razor view. What syntax should I use to make this working? I get warnings eg. Expected constant on the isOk variable among other. (Without text tag, the following code is not recognized as javascript)
@{bool isOk = true;}
<script type="text/javascript">
var tmp1 = "";
@if (isOk)
{
<text>
var tmp=""; // this should be interpreted as javascript
</text>
}
</script>