title: Is there a checkbox equivalent to @HTML.dropdownlist
body: <p>I'm developing a simple blog application where users submitting a new post can also choose to associate a selection of predefined tags to their Post.</p>
  
  <p>Currently, users can select multiple tags (holding ctrl) using a dropdownlist:</p>
  
  <p><a href="https://i.stack.imgur.com/I1AgL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I1AgL.jpg" alt="enter image description here"></a></p>
  
  <p>However, aesthetically this is not really what I want to use for this purpose and would prefer to let users select desired tags from a series of checkboxes, or even better - buttons. Similar to this:</p>
  
  <p><a href="https://i.stack.imgur.com/FXCrt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FXCrt.png" alt="enter image description here"></a></p>
  
  <p>Does such an equivalent HTML helper exist?</p>
  
  <p>My working code with dropdownlist is below for your reference. </p>
  
  <p>VIEW: </p>
  
  <pre><code>    &lt;div class="form-group"&gt;
          @Html.DropDownList("TagId", (MultiSelectList)ViewBag.Tags, new { multiple = "multiple" })
      &lt;/div&gt;
  </code></pre>
  
  <p>CONTROLLER: </p>
  
  <p>_context is my database containing two tables, Post and Tags.</p>
  
  <pre><code>    public ActionResult Add()
      {
  
          var tags = _context.Tags.Select(c =&gt; new {
              TagID = c.TagID,
              Type = c.Type
          }).ToList();
  
          ViewBag.Tags= new MultiSelectList(tags, "TagID", "Type");
  
          return View();
      }
  
      [AcceptVerbs("POST")]
      public ActionResult Add()
      {
  
           string TagId= Request["TagID"];
  
           var tagids = TagId.Split(',');
  
           foreach (var tagid in tagids)
           {
                 var id = int.Parse(tagid);
                 Tag tag = _context.Tags.Where(ct =&gt; ct.TagId== id).First();
                 post.Tags.Add(tag);
          }
  
          //Save our post
          _context.Post.Add(post);
          _context.SaveChanges();
  
  
          return View();
      }
  </code></pre>
  
  <p>Any alternative suggestion are also highly appreciated, particularly as I'm still learning the ropes - thanks! </p>