So I'm writing an ASP.NET MVC Web application and at the top of one of my razor pages i have this code:
<script type="text/javascript">
alert("@TempData["alertMessage"]");
</script>
If I understand the error
Unterminated string constant
correctly, it means I haven't closed the quotation marks. But if I look at the code it should be closed correctly right?
What is wrong about it?
alert("@(TempData["alertMessage"])");