title: Dropdownlist using viewbag data in mvc4 using c#
body: <p>Hi i want to fill a dropdown list in my view page my code is</p>
  
  <pre><code>public class MemberBasicData
  {
      public int Id { get; set; }
      public string Mem_NA { get; set; }
      public string Mem_Occ { get; set; }
  }
  </code></pre>
  
  <p>//controller</p>
  
  <pre><code>  public ActionResult Register()
      {
          var users = new Member().GetAllMembers();
          ViewBag.Users = users;   
          return View();
      }
  </code></pre>
  
  <p>//View</p>
  
  <pre><code> @model IEnumerable&lt;....Members.Models.MemberBasicData&gt;
   @Html.DropDownListFor(model =&gt; model.Mem_Na, (SelectList)ViewBag.Users, "--Select Users--")
  </code></pre>
  
  <p>i want to add Mem_NA to dropdownlist, Viewbag contains all the user details. Problem is in View page. An error shows in model.Mem_Na. Please help me to solve this.</p>