title: How to set default value to empty EditorFor-field when post a form i .NET MVC
body: <p>I have a form in .NET MVC 5. where the user can write a number, default is "0", If the user deletes a number e.g. "233" an leaving the field empty. The form would not submit. </p>
  
  <p>How can I submit the form with an empty field?</p>
  
  <pre><code>public class myModel 
  {
      public int nummer { get; set; }
      public myModel(){}
      public myModel(int i) {this.nummer = i;}
  }
  </code></pre>
  
  <p>razor code:</p>
  
  <pre><code>using (Html.BeginForm("myAction", "myController", FormMethod.Post, new { @class = "form-inline" }))
  {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true, "", new { @class = "text- danger" })
      @Html.EditorFor(model =&gt; model.nummer, new { htmlAttributes = new { @class = "form-control " } })
      &lt;input type="submit" value="submit" name="btnSubmit"/&gt;
  }
  </code></pre>
  
  <p>I am not interested in a validation error message, but to have the value set to "0", by default.</p>