title: How to add checkboxes in dropdown list MVC view
body: <p>Hi I am trying to add checkbox in my drop downlist.
  I googled it and I am getting example in asp.net as I am trying to  do in MVC3.
  On my form edit User must be able to check values in the dropdown list.
    For example in below form for manufactures list  currently it is just displaying values I must provide with a checkbox associated with that value.</p>
  
  <p>My form:</p>
  
  <pre><code> &lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;EmsAdmin.Models.User&gt;" %&gt;
   &lt;%@ Import Namespace="EmsAdmin.Models" %&gt;
  
   &lt;script type="text/javascript"&gt;
    //&lt;![CDATA[
      // Focus on the first input box for the site
      $(document).ready(function () {
        $('#UserId').focus();
      });
    //]]&gt;
  &lt;/script&gt;
  
  &lt;%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %&gt;
  &lt;% using (Html.BeginForm()) {%&gt;
    &lt;%= Html.AntiForgeryToken() %&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.Id,"Id:") %&gt;
      &lt;%: Model.Id %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.PersonId,"Person:") %&gt;
      &lt;%= Html.DropDownListFor(e =&gt; e.PersonId, (SelectList)ViewData["allPersons"], "Select a person", new { @style = "width: 255px;" })%&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.Person,"") %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.Email,"Email:") %&gt;
      &lt;%= Html.TextBoxFor(e =&gt; e.Email, new { @style = "width:250px;" })%&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.Email,"") %&gt;
    &lt;/p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.Approve,"Aprrove User:") %&gt;
      &lt;%= Html.CheckBoxFor(e=&gt; e.Approve,Model.Approve) %&gt;&lt;span&gt;&amp;nbsp;Switch this on if you want to add regitrar &lt;/span&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.Approve,"") %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.ManufacturerDescription,"Brand:") %&gt;
      &lt;%= Html.DropDownListFor(e =&gt; e.ManufacturerDescription, (SelectList)ViewData["allManufacturers"], "Select  Brands", new { @style = "width: 255px;" })%&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.ManufacturerDescription,"") %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.CountryName,"Country:") %&gt;
      &lt;%= Html.DropDownListFor(e =&gt; e.CountryName, (SelectList)ViewData["allCountries"], "Select Countries", new { @style = "width: 255px;" })%&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.CountryName,"") %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= Html.LabelFor(e=&gt;e.Role,"Role:") %&gt;
      &lt;%= Html.DropDownListFor(e =&gt; e.Role, (SelectList)ViewData["allRoles"], "Select Roles", new { @style = "width: 255px;" })%&gt;
      &lt;%= Html.ValidationMessageFor(e=&gt;e.Role,"") %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;input type="submit" value="Save" /&gt;
      &lt;%= Html.ActionLink("Cancel","Details",new {id=Model.Id},new {@title="exit without saving"}) %&gt;
    &lt;/p&gt;
  &lt;% } %&gt;
  </code></pre>