Escape @ character in razor view engine

ajay_whiz picture ajay_whiz · Sep 2, 2010 · Viewed 242k times · Source

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

Tobiasopdenbrouw picture Tobiasopdenbrouw · Sep 2, 2010

@@ should do it.