title: Binding Model.ID to Checkbox list and post Model.X, Model.Y, etc. properties to Controller
body: <p>In an <code>MVC</code> application I joined multiple tables and returned it from <code>Controller</code> to <code>View</code> as shown below:</p>
  
  <pre><code>| EmployeeID | ControlID | DoorAddress | DoorID | DoorName |
  ------------------------------------------------------------
  |  921       |     1     |      1      |  101   | Door 1   |
  |  921       |     1     |      2      |  102   | Door 2   |
  |  921       |     1     |      3      |  103   | Door 3   |
  |  921       |     1     |      4      |  104   | Door 4   |
  ------------------------------------------------------------
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult Edit(int? id)
  {
      // Create and execute raw SQL query.
      string query = "SELECT a.EmployeeID, a.ControlID, a.DoorAddress, t.DoorID, t.DoorName FROM TEmpAccess AS a " +
                     "INNER JOIN TDoor AS t ON a.ControlID = t.ControlID and a.DoorAddress = t.DoorAddress where EmployeeID = " + id.ToString();
      IEnumerable&lt;EmpAccessViewModel&gt; data = db.Database.SqlQuery&lt;EmpAccessViewModel&gt;(query);
  
      return View(data.ToList());
  }
  </code></pre>
  
  <p>I want to bind <code>DoorName</code> values (Door 1, Door 2, Door 3, Door 4) to a <code>checkbox list</code> and let the user to select them. After that, I want to pass corresponding <code>EmployeeID</code>, <code>ControlID</code>, <code>DoorAddress</code>, <code>DoorID</code> values of the the selected door to the <code>Controller</code>. For example if the user selects Door 1 and Door 3, then I will pass these values below to the <code>Controller</code>:</p>
  
  <pre><code>| EmployeeID | ControlID | DoorAddress | DoorID |
  -------------------------------------------------
  |  921       |     1     |      1      |  101   | 
  |  921       |     1     |      3      |  103   | 
  -------------------------------------------------
  </code></pre>
  
  <p>By using <code>razor</code> syntax or <code>javascript</code> in the view, how can I do this? Thanks in advance.</p>