title: How to use hidden field values from view to controller in asp.net mvc 3
body: <p>I have to pass hidden filed values to controller action. So I have tried in the following way, but I am getting null values.</p>
  
  <p>I have tried both methods i.e formcollection and viewmodel concept </p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public ActionResult MapIcon()
  {
      Hidden hd = new Hidden();
      return View(hd);
  }
  
  [HttpPost]
  public ActionResult MapIcon(Hidden hidden)
  {
      var value=hidden.hiddevalue;//null
      FormCollection col = new FormCollection();
      var value = col["hidden1"];
    //  string value = mycontroler.ControlName;
  
      return View(hidden);
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>@model SVGImageUpload.Models.Hidden
  Razor view:@using (Html.BeginForm(new { id = "postform" }))
  {
      &lt;input type="hidden" id="" value="7" name="hidden1" /&gt;
      &lt;input type="hidden" id="" value="7"  name="hidden2"/&gt;
  
      &lt;input type="submit" value="Match"/&gt;
  }
  </code></pre>
  
  <p><strong>Viewmodel</strong></p>
  
  <pre><code>public class Hidden
  {
    public string hiddevalue { get; set; }
  }
  </code></pre>