title: Parsing Form Post Values From a Table in ASP.NET MVC?
body: <p>Ok, I'm an MVC newbie coming from a webforms background, so please excuse any ignorance here. Here is my scenario. I've got a table consisting of a list of applications and associated permissions. Each table row consists of 3 pieces of information: a checkbox, some text describing the row, and a dropdown list allowing the user to select the appropriate permission for the application. I want to post this data and only work with the rows in the table which were checked (the id of the row is embedded as the checkbox name). From there, I want to grab the selected value from the DropDownList, and call the necessary code to update the DB. Here is my View page's code:</p>
  
  <pre><code>            &lt;%foreach (var app in newApps)
                { %&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;input type="checkbox" name="AddApps" value="&lt;%=app.ApplicationId %&gt;" /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=Html.Encode(app.ApplicationName)%&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=Html.DropDownList("AppRole", new SelectList(app.Roles, "RoleId", "RoleDescription"))%&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;%} %&gt;
  </code></pre>
  
  <p>How would I retrieve the appropriate values from the FormCollection when I get to the controller on form post? I have done this in the past when I only had checkbox values to retrieve by just calling Request.Form["CheckBoxName"] and parsing the string. </p>
  
  <p>Or am I going about this entirely wrong?</p>