title: How to validate an input out of model in MVC5
body: <p>I have been trying to validate an input which is not properly in the model. I have the following code:</p>
  
  <pre><code>@using (Html.BeginForm("Address", "Locations", FormMethod.Post, new { id = 
  "mainForm" }))
  {
  @Html.AntiForgeryToken()
  @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  
  &lt;div class="card shadow-sm"&gt;
      &lt;div class="card-header"&gt;
          &lt;h3 class="card-title"&gt;
              Step 1
          &lt;/h3&gt;
          &lt;label&gt;
              Search for service location(s)
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="card-body"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-4"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="exampleInputEmail1"&gt;Zip code: &lt;span class="text-danger"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type="text" class="form-control" id="ZipCode" name="ZipCode" autocomplete="off" autofocus /&gt;
                      @Html.ValidationMessage("ZipCode")
  
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-md-4"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="exampleInputPassword1"&gt;House number:&lt;/label&gt;
                      &lt;input type="text" class="form-control" id="HouseNumber" name="HouseNumber" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="col-md-4"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label for="exampleInputPassword1"&gt;City:&lt;/label&gt;
                      &lt;input type="text" class="form-control" id="City" name="City" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="card-footer"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-12"&gt;
                  &lt;button class="btn btn-primary" type="submit"&gt;
                      &lt;i class="fas fa-search"&gt;&lt;/i&gt;
                      Search for location(s)
                  &lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>The mode is </p>
  
  <pre><code>@model PagedList.IPagedList&lt;iCRM.Models.Address&gt;
  </code></pre>
  
  <p>But the name which I gave to the input is not in the model. However the validation is not working at all. And the POST is ignoring my validation. </p>
  
  <p>Can somebody help me out, what I am doing wrong?</p>
  
  <p>Thanks in advance. </p>