title: What is the ASP.NET MVC equivalent of displaying a Label conditionally?
body: <p>I'm currently porting an ASP.NET WebForms application to ASP.NET MVC. </p>
  
  <p>In one of the pages there is an ASP.NET Label control which is displayed conditionally based on a variable in the codebehind. So, something to the effect of</p>
  
  <pre><code>&lt;asp:Label runat="server" Visible="&lt;%# ShowLabel%&gt;"&gt;
  ...
  &lt;/asp:Label&gt;
  </code></pre>
  
  <p>Where ShowLabel is a Boolean value in the codebehind. The contents of the label are generated at runtime and will be different pretty much every time.</p>
  
  <p>There's better ways to do this even in ASP.NET, but what would be the best way to do this in ASP.NET MVC? How are you even supposed to render dynamic text in ASP.NET MVC in a way similar to how the ASP.NET Label object worked?</p>