title: Condition to display document link (href) in WebMatrix Webgrid
body: <p>I would like to display a "DOC" link in a Webgrid when a document (path) exists.</p>
  
  <p>The document full path is constructed from a generic path (path data stored in the settings table) and a document specific path (path data stored in another table).</p>
  
  <p>The below will work but there is no condition and  no constructed path !</p>
  
  <pre><code>meetingsGrid.Column("Agenda", format: @&lt;a href="document full path"&gt;DOC&lt;/a&gt;)
  </code></pre>
  
  <p>This does not work:</p>
  
  <pre><code>meetingsGrid.Column("Agenda", format: @&lt;a href="generic path" + "document specific path"&gt;DOC&lt;/a&gt;)
  </code></pre>
  
  <p>Tried this:</p>
  
  <pre><code>meetingsGrid.Column("Agenda", format: @&lt;a href="@Url.Action(Path.Combine(@genericpath,specificpath))"&gt;DOC&lt;/a&gt;)
  </code></pre>
  
  <p>I have tried to add some conditions but even with the full path, I couldn't make it work :-(</p>
  
  <pre><code>meetingsGrid.Column("Agenda", format: @if(meetingsData.AgendaPath!=null){@&lt;a href="fullpath"&gt;DOC&lt;/a&gt;)}else{@Html.Raw("")}
  
  meetingsGrid.Column("Agenda", format: (item) =&gt; @Html.Raw((item.AgendaPath!=null) ? (@&lt;a href="fullpath"&gt;DOC&lt;/a&gt;) : ""))
  </code></pre>
  
  <p>Thanks for your help</p>