title: SelectList rendering with multiple = "multiple" when I don't want it to
body: <p>I am trying to create a simple <code>SelectList</code> that renders as a <code>dropdown</code> for use in a Create form generated with RazorPages.  For some reason, the <code>SelectList</code> renders with <code>multiple="multiple"</code> which results in all the options being shown in a frame with a scrollbar on the side instead of a <code>dropdown</code>.  I believe the issue lies with my controller and the fact that I am trying to set both the "Text" and "Value" attributes of the <code>SelectListItems</code> with an anonymous type, as I have achieved the desired result when not setting those attributes.</p>
  
  <p>A lot of this is very new to me, so if anyone has any general advice with regard to my code, I would appreciate it.</p>
  
  <p>Here is my view model:</p>
  
  <pre><code>public class CreateFileViewModel
      {
          public SelectList EnrolleeId { get; set; }
          public SelectList GroupId { get; set; }
  
          [DataType(DataType.Date)]
          public DateTime StartDate { get; set; }
  
          public string Status { get; set; }
      }
  </code></pre>
  
  <p>Here is my controller:</p>
  
  <pre><code>public IActionResult TestCreate()
          {
              //query items for SelectLists
              var users = from u in _context.Users
                          orderby u.LastName
                          select u;
  
              var groups = from g in _context.Group
                           orderby g.Name
                           select g;
  
              // Loop through queries above and convert to collections of SelectListItems
              var enrolleeSelectListItems = from u in users
                                          select new SelectListItem()
                                          {
                                              Value = u.Id.ToString(),
                                              Text = u.LastName + ", " + u.FirstName + " " + u.MiddleName
                                          };
  
              var groupSelectListItems = from g in groups
                                           select new SelectListItem()
                                           {
                                               Value = g.ID.ToString(),
                                               Text = g.Name
                                           };
  
              //convert SelectListItem collections into SelectLists within view
              var cfvm = new Models.TestModels.CreateFileViewModel();
              cfvm.EnrolleeId = new SelectList(enrolleeSelectListItems, "Value", "Text");
              cfvm.GroupId = new SelectList(groupSelectListItems, "Value", "Text");
  
              return View(cfvm);
          }
  </code></pre>
  
  <p>This is the relevant portion of my view:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
                  &lt;label asp-for="EnrolleeId" class="control-label"&gt;&lt;/label&gt;
                  &lt;select asp-for="EnrolleeId" asp-items="Model.EnrolleeId"&gt;
                      &lt;option value=""&gt;Select&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>and here is how it renders in the browser:</p>
  
  <pre><code>&lt;select id="EnrolleeId" multiple="multiple" name="EnrolleeId" aria-invalid="false" class="valid"&gt;
                      &lt;option value=""&gt;Select&lt;/option&gt;
                      &lt;option value="3e60fabd-6901-45a1-ae2a-5056d77f415c"&gt;&lt;/option&gt;
                      &lt;option value="40ce8b6e-62a5-4c3c-808b-90e36d633ec0"&gt;&lt;/option&gt;
                      &lt;option value="c0c49df2-da52-4a01-9a8a-47bab6f5496d"&gt;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>