Home How to use properly razor syntax inside script block?
 I work on an ASP.NET MVC 5 project. I try to use razor syntax in script area on the cshtml page:   But when I run the page I get on this row: url = '@Url.Content("~/Account/GetLayers/")';  This error: CS1012: Too many characters in character literal So I tried this:  url = "@Url.Content("~/Account/GetLayers/")";  But now I get this error: CS1002: ; expected Any idea why my attempts above don't work?