title: Passing Razor MVC Form to Controller
body: <p>I have a table <a href="https://i.stack.imgur.com/Kc7JP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kc7JP.png" alt="here"></a> in which each row has a jQuery datepicker in the last cell. Along with a submit button labeled 'Update'. The last cell also contains the Issue.ID in a hidden textbox. I am trying to retrieve these values in my controller but I get a System.ArgumentOutOfRangeException. 
  Here is part of my view:</p>
  
  <pre><code>@foreach (Issue issue in Model.IssueSet.IssueList)
          {
              &lt;tr class="altsec" id="@issue.RowID"&gt;
              &lt;td&gt;@issue.Zone.ToString()&lt;/td&gt;
              &lt;td&gt;@issue.Station.ToString()&lt;/td&gt;
              &lt;td&gt;@issue.WhenOpened.Date.ToShortDateString()&lt;/td&gt;
              &lt;td&gt;@issue.What.ToString()&lt;/td&gt;
              &lt;td&gt;@issue.Why.ToString()&lt;/td&gt;
              &lt;td&gt;@issue.How.ToString()&lt;/td&gt;
              &lt;td&gt;@issue.Who.ToString()&lt;/td&gt;
              &lt;td&gt;
              @using (Html.BeginForm()) {
                  &lt;fieldset&gt;
                      &lt;input type="text" style="width: 100px; display: none" value="@issue.ID" name="stringID"/&gt;
                      &lt;input class="datepicker" type='text' style="width: 100px" id="@issue.DateID" /&gt;
                      &lt;input class="updateButtons" type="submit" value="Update" /&gt;&lt;/fieldset&gt;
              }&lt;/td&gt;
             &lt;/tr&gt;
          }
  </code></pre>
  
  <p>My controller for POST is as follows:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Index(string stringID)
      {
          var ID = Request.Form[0].ToString();
          var date = Convert.ToDateTime(Request.Form[1]);
  
          string strSQL = "UPDATE bp_open_issues SET WhenFixed = '" + date + "' WHERE ID = '" + ID + "' ";
          SqlConnection con =
                  new SqlConnection("Data Source=10.67.XX.XXX;Initial Catalog=XXX111; User Id=XXXXXX; Password=XXXXXX;");
          SqlCommand cmd = new SqlCommand(strSQL, con);
          con.Open();
          cmd.ExecuteNonQuery();
          TempData["msg"] = "&lt;script&gt;alert('Change succesfully');&lt;/script&gt;";
          return Redirect("/");
      }
  </code></pre>