title: Switch statement inside Razor CSHTML
body: <p>I'm developing a project in ASP.NET MVC4, Twitter.Bootstap 3.0.0 and Razor. In a View, I need to display buttons depending of a property value. Using the <code>switch</code> statement, the example below doesn't work (nothing is displayed):</p>
  
  <pre><code>@switch (Model.CurrentStage) { 
      case Enums.Stage.ReadyToStart:
          Html.ActionLink(Language.Start, "Start", new { id=Model.ProcessId }, new { @class = "btn btn-success" });
          break;
      case Enums.Stage.Flour:
          Html.ActionLink(Language.GoToFlour, "Details", "Flours", new { id=Model.Flour.FlourId }, new { @class = "btn btn-success" });
          break;
      ...
  }
  </code></pre>
  
  <p>Changing a bit, using a <code>&lt;span&gt;</code> tag, the code works:</p>
  
  <pre><code>@switch (Model.CurrentStage) { 
      case Enums.Stage.ReadyToStart:
          &lt;span&gt;@Html.ActionLink(Language.Start, "Start", new { id=Model.ProcessId }, new { @class = "btn btn-success" })&lt;/span&gt;
          break;
      case Enums.Stage.Flour:
          &lt;span&gt;@Html.ActionLink(Language.GoToFlour, "Details", "Flours", new { id=Model.Flour.FlourId }, new { @class = "btn btn-success" })&lt;/span&gt;
          break;
      ...
  }
  </code></pre>
  
  <p>Can someone explain why?</p>
  
  <p>Thanks.</p>