title: Creating a SelectList which contains Integers
body: <p>I am trying to create a dropdown allowing users to select quantity of tickets. I have a createOrder method which displays the tickets available depending on the event chosen. I want to first check how many ticketsAvailable for the event then depending on the quantity available populate my selectlist</p>
  
  <p>Here is my code so far</p>
  
  <pre><code> public ActionResult CreateOrder(int id)
      {
          Event e1 = db.Events.Find(id);
          List&lt;SelectListItem&gt; quantities = new List&lt;SelectListItem&gt;();
          ViewBag.listTickets = (from t in db.Tickets where t.EventID == id select t).ToList();
          if (e1.TicketsAvailable == 0)
          {
              return View("Error");
          }
          else if (e1.TicketsAvailable &lt; 5)
          {
              for (int loop = 0; loop &lt; e1.TicketsAvailable; loop++)
              {
                  quantities.Add(new SelectListItem { Text = loop.ToString(), Value = loop.ToString() });
              }
          }
          else
          {
              for (int loop = 0; loop &lt;= 5; loop++)
              {
                  quantities.Add(new SelectListItem { Text = loop.ToString(), Value = loop.ToString() });
              }
          }
              ViewBag.Quantities = quantities;
              return View();
  
          }
  </code></pre>
  
  <p>And my View </p>
  
  <pre><code>&lt;head&gt;
  &lt;title&gt;Order&lt;/title&gt;
  &lt;link rel="stylesheet" href="~/Content/TableSheet.css"&gt;
  @using GeogSocSite.Models
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Choose Your Tickets&lt;/h1&gt;
  &lt;table align="center" cellspacing="2" border="1"&gt;
     &lt;tr&gt;
         &lt;th align="center"&gt;Description&lt;/th&gt;
         &lt;th align="center"&gt;Price&lt;/th&gt;
         &lt;th align="center"&gt;Add&lt;/th&gt;
     &lt;/tr&gt;
      @foreach(GeogSocSite.Models.Ticket t in ViewBag.listTickets)
     {
     &lt;tr&gt;
         &lt;td align="center"&gt;@t.Description&lt;/td&gt;
         &lt;td align="center"&gt;@t.Price&lt;/td&gt;
         &lt;td align="center"&gt;@Html.ActionLink("Add to Cart", "AddToCart", "Order", new { id = t.TicketID })&lt;/td&gt;
        &lt;td align="center"&gt; @Html.DropDownList("Quantity", new SelectList(ViewBag.Quantities)) &lt;/td&gt;
     &lt;/tr&gt;
     }
  &lt;/table&gt;
  &lt;div&gt;
      @Html.ActionLink("Back to List", "Index","Events")
  &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>However this does not work the text shown in the dropdown is wrong. If I use an ordinary List this works but then I think this means users won't be able to select from these values. If anyone could help me with this I'd really appreciate it as I've been stuck for a long time on this!</p>