title: got an error while using @if in razor
body: <p>I've got an error when I tried to use if clause in razor like this:</p>
  
  <p>Unexpected "if" keyword after "@" character.  </p>
  
  <pre><code>@foreach (var item in Model) {
  @if (item.Country != "No Country")
  {
      &lt;li&gt;@Html.ActionLink(item.CountryWithCount, "IndexByProv", "EventInfo", new { country = item.Country }, null)&lt;/li&gt;
  </code></pre>
  
  <p>Why I got this error?</p>