title: ASP.NET MVC, Bootstrap Tables, get values for each column
body: <p>In ASP.NET MVC, I've an action which takes user input about rows and columns and then it navigates to the action which generates required number of rows and columns based on the user input as shown below:-</p>
  
  <p>Views:</p>
  
  <pre><code>&lt;div class="container" style='width:@(240 * Model.Columns.Capacity)px;overflow-y:auto'&gt;
  &lt;div class="row"&gt;
      @using (Html.BeginForm())
      {
          &lt;table style='width:100%' class='table table-condensed'&gt;
              &lt;tbody&gt;
                  @for (int k = 0; k &lt; Model.Rows.Capacity; k++)
                  {
                      &lt;tr&gt;
                          @for (int i = 0; i &lt; Model.Columns.Capacity; i++)
                          {
                              &lt;td&gt;
                                  @Html.TextBox("name" + k + i, null, new { @class = "form-control" })
                              &lt;/td&gt;
                          }
                      &lt;/tr&gt;
                  }
              &lt;/tbody&gt;
          &lt;/table&gt;
  
          &lt;input type="submit" name="name" value="Submit" class="btn btn-primary" /&gt;
      }
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>And after entering.</p>
  
  <p><a href="http://i.stack.imgur.com/lxhOM.png" rel="nofollow">http://i.stack.imgur.com/lxhOM.png</a></p>
  
  <p>In the post action, I've a form collection in order to get the filled data in the post action using a form collection. In the post action I get the values for each input field using a foreach loop.</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Enter(FormCollection form)
      {
          for (int i = 0; i &lt; form.Count; i++)
          {
              Debug.WriteLine(form[i]);
          }
          return View();
      }
  </code></pre>
  
  <p>I just want to know that how to get all the values of a single column in the post action and get them column by columns, by default it gets the values of horizontally. </p>
  
  <p>Thanks.
  <a href="http://i.stack.imgur.com/SBMvY.png" rel="nofollow">http://i.stack.imgur.com/SBMvY.png</a></p>