title: ASP.NET Core 2.1 Razor Form, Post not reaching Controller
body: <p>I spent a good margin of time searching and working through this problem yesterday without coming up with a solution. <a href="https://jonhilton.net/2017/08/17/how-to-get-data-from-an-html-form-to-your-asp.net-mvc-core-controller/?fbclid=IwAR3iymMfGeUjOnUu-rIHZv-9TGDGGCWbUQQbwDBnBxibFMxINYVBp-ZLwqo" rel="noreferrer">Here is the guide I used as reference.</a> </p>
  
  <p>The problem is that the data from the form is not reaching my controller. My goal is to take the form data and pass it to my controller/ model so that I can use the values throughout my code and store them in the database. Below is what I have so far...</p>
  
  <p>In my Browse.cshtml (View)</p>
  
  <pre><code>@model Collect
  
  &lt;form asp-action="Collect" asp-controller="Collect" method="post"&gt;
  &lt;input type="hidden" asp-for="GameId" name="@game.id"/&gt;
  &lt;button type="submit" class="dropdown-item btn btn-block"&gt;Default&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>In my CollectController.cs (Controller)</p>
  
  <pre><code>using System;
  using GameLibrary.me.Models;
  using Microsoft.AspNetCore.Mvc;
  
  namespace GameLibrary.me.Controllers
  {
  public class CollectController  : Controller
  {
      [HttpGet]
      public IActionResult Collect()
      {
          return View();
      }
  
      [HttpPost, ValidateAntiForgeryToken]
      public IActionResult Collect(Collect model)
      {
  
          Console.WriteLine("**********\n"+model.GameId+"\n**********");
  
          return Content($"Hello {model.GameId}");
      }    
    }
  }
  </code></pre>
  
  <p>In my Collect.cs (Model)</p>
  
  <pre><code>namespace GameLibrary.me.Models
  
  {
  public class Collect
  {
      public int GameId { get; set; }
    }
  }
  </code></pre>
  
  <p>EDIT: Here is what my IDE is telling me...</p>
  
  <pre><code>info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
    Request starting HTTP/1.1 POST https://localhost:5001/browse?game=eevee application/x-www-form-urlencoded 7
  
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
    Request finished in 1.0139ms 200
  
  info: Microsoft.AspNetCore.Server.Kestrel[32]
    Connection id "0HLJHIUOU6AKO", Request id "0HLJHIUOU6AKO:00000003": the application completed without reading the entire request body.
  </code></pre>
  
  <p>Any guidance on what I am doing wrong would be great appreciated... Also can I send multiple values through the hidden field type, or should I make a new hidden field type for each value? </p>