title: MVC 5 Razor - Listbox that displays items passed in a Viewbag list
body: <p>I am passing a ViewBag list to my view and I am trying to display this list in a listbox so as I can select items of this list.</p>
  
  <p>This is the controller method for the view:</p>
  
  <pre><code> public ActionResult AddMembers(int? id)
          {
              ViewBag.lstMembers = db.ClubMembers.ToList();
  
              var selClub = db.Clubs.Find(id);
              if (id == null)
              {
                  return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
              }
  
              return View(selClub);
  
          }
  </code></pre>
  
  <p>This is what I have currently but it is not displaying the items correctly as shown in the photo below:</p>
  
  <pre><code>@Html.ListBoxFor(m =&gt; m.ClubMembers, new SelectList ( ViewBag.lstMembers))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/CrtZJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CrtZJ.jpg" alt="enter image description here"></a></p>
  
  <p>How can I set the source of my listbox so that it will display the items passed in via the ViewBag.lstMembers from the controller method</p>