Escape @ character in razor view engine

后端 未结 15 1988
梦谈多话
梦谈多话 2020-11-22 07:55

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

15条回答
  •  不要未来只要你来
    2020-11-22 08:28

    For the question about @RazorCodePart1 @@ @RazorCodePart2, you need to the sequence:

    @RazorCodePart1 @:@@ @RazorCodePart2
    

    I know, it looks a bit odd, but it works and will get you the literal character '@' between the code blocks.

提交回复
热议问题