title: How to Display Conditional Plain Text with Razor
body: <p>I am having issues with displaying (rather NOT displaying) plain text in an else block.</p>
  
  <pre><code>if (Model.CareerFields != null &amp;&amp; ViewBag.CFCount &gt; 0)
  {
  &lt;h3&gt;Careerfields Listing&lt;/h3&gt;
  
  &lt;table&gt;
     &lt;tr&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;Careerfield Name&lt;/th&gt;
     &lt;/tr&gt;
  
     @foreach (var item in Model.CareerFields)
     {
         &lt;tr&gt;
         &lt;td&gt;
            @Html.ActionLink("Select", "Index", new { careerFieldID = item.CareerFieldId })
         &lt;/td&gt;
         &lt;td&gt;
            @item.CareerFieldName
         &lt;/td&gt;
         &lt;/tr&gt;
     }
     &lt;/table&gt;
  }
  else
  {
    No Careerfields associated with @ViewBag.SelectedDivisionTitle
  }
  </code></pre>
  
  <p>The if blocks works fine. The text only renders when true. However, the else block text renders when the page loads, not if it evaluates to false only. </p>
  
  <p>I've tried using </p>
  
  <pre><code>Hmtl.Raw("No Careerfields associated with ")
  &lt;text&gt;No Careerfields associated with @ViewBag.SelectedDivisionTitle&lt;/text&gt;
  @:No Careerfields associated with @ViewBag.SelectedDivisionTitle
  </code></pre>
  
  <p>But it still renders the plaintext before evaluation.</p>
  
  <p>Any suggestions?</p>