Every time I utilize the @ sign in a Razor page, like this:
<script type="text/javascript">
if( @(ProjectName.NameSpace.booleanVariable) ) {
doStuff();
}
</script>
I end up with syntax error alerts all over, which disappear after conversion to HTML:
<script type="text/javascript">
if(True) {
doStuff();
}
</script>
This is just one example, but it occurs in other situations too. If needed, I can provide more examples. Although I couldn't find a solution on other stackoverflow posts, I assume there must be an answer to such a basic question. Links to relevant questions are welcome.
Edit: I should clarify that the examples are JS inside a Razor Page.
Question: How can I stop these syntax error notifications so that I can easily spot and handle actual syntax errors?