Tuesday 23 July 2019

asp.net mvc 3 - Escape @ character in razor view engine



I am creating a sample ASP.NET MVC 3 site using Razor as view engine. The razor syntax starts with @ character e.g. @RenderBody(). If I write @test on my cshtml page it gives me parse error




CS0103: The name 'test' does not exist in the current context




How do I escape '@' character?



Answer



@@ should do it.




No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...