In Razor syntax for conditional checking, you can run a block with a single @ sign, and then put your condition inside.
For instance,
@{var price=20;} <html> <body> @if (price>30) { <p>The price is too high.</p> } else { <p>The price is OK.</p> } </body> </html>
So, in your case, you use two @ inside the same block. Check this part and it will be resolved.
So, your code block should look like this.
<div> @if (Model == null) { <p>@string.Format("{0}", "test")</p> } </div>
Also, if you put the β@β two times, as it is in your code lines, it will give you a hint like the image below. This is a feature of Razor 4.0 syntax. Also you will skip ";" in your line of code.

http://www.w3schools.com/aspnet/razor_cs_logic.asp
source share