title: How to conditionally set an html input value to blank
body: <p>I have a razor file containing the line:</p>
  
  <pre><code>&lt;input type="hidden" class="personId" value=@(Model != null ? Model.Id : "") /&gt;
  </code></pre>
  
  <p>So I was aiming for when the Model exists set the value of the hidden control to the Id of the model. When it doesn't exist value="".</p>
  
  <p>What I got was value="/"</p>
  
  <p>So I tried instead:</p>
  
  <pre><code>&lt;input type="hidden" class="personId" value=@(Model != null ? Model.Id : string.Empty)/&gt;
  </code></pre>
  
  <p>Same result.</p>
  
  <p>Tried:</p>
  
  <pre><code>&lt;input type="hidden" class="personId" value=@(Model != null ? Model.Id : null)/&gt;
  </code></pre>
  
  <p>Same again.</p>
  
  <p>Why can't I set it to empty?</p>
  
  <p>Is this even the right approach should I omit value all together?</p>