title: Pass Model from View to Controller
body: <p>I want to pass model to Post method of controller. When method is called it shows null value for content and 0 for Id. Ideally it should contain the values of model it has displayed.</p>
  
  <p><img src="https://i.stack.imgur.com/bNTYP.png" alt="enter image description here"></p>
  
  <p>View:</p>
  
  <pre><code>@model MvcApplication4.Models.WorldModel
  @{
      ViewBag.Title = "Information";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  
  @using (Html.BeginForm("Information", "World", FormMethod.Post))
  {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true)
      &lt;br /&gt;
      @Html.DisplayFor(model =&gt; model.Id)
      &lt;br /&gt;
      @Html.DisplayFor(model =&gt; model.Content)
      &lt;br /&gt;
      &lt;input type="submit" value="Next" /&gt;
  }
  </code></pre>
  
  <p>Controller: Method called when click on submit button.</p>
  
  <pre><code>        [HttpPost]
          [ValidateAntiForgeryToken]
          public ActionResult Information(WorldModel worldModel)
          {
              CandidateSession cs = (CandidateSession)Session["Can"];
              var can = cs.Candidates.Where(x =&gt; x.IsNameDispalyed == false);
              if (can.Count() &gt; 0)
              {
                  var can1 = can.First();
                  can1.IsNameDispalyed = true;
                  Session["Can"] = cs;
                  return View(new WorldModel() { Id = can1.Id, Content = can1.Name });
              }
              return View(new WorldModel());
          }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public class WorldModel
      {
          public int Id { get; set; }
  
          public string Content { get; set; }
      }
  </code></pre>