title: No options coming up from my dropdown list?
body: <p>I have created a hard-coded dropdown list in my controller where I want to be able to create an option that will then be saved in my database. The idea is that I should be able to create a Ticket and then be able to choose whether it should be Open or Closed. The problem is that I can not come up with any options in my view once I create a Ticket. Options are displayed when I do an Update on a Ticket. However, the options do not seem to be saved once I update my Ticket either.</p>
  <p><strong>Controller for Create, Here I have my hard-coded list</strong></p>
  <pre><code>  public IActionResult Create(int? id)
          {
  
              TicketVM obj = new TicketVM();
              obj.ProjectList = _db.Projects.Select(i =&gt; new SelectListItem
              {
                  Text = i.Name,
                  Value = i.Project_Id.ToString()
  
              });
              if (id == null)
              {
                  return View(obj);
              }
  
  
  
              // Status List
              #region
              List&lt;SelectListItem&gt; statusList = new List&lt;SelectListItem&gt;();
              statusList.Add(new SelectListItem()
              {
  
                  Value = &quot;Open&quot;,
                  Text = &quot;Open&quot;
              });
  
              statusList.Add(new SelectListItem()
              {
  
                  Value = &quot;Closed&quot;,
                  Text = &quot;Closed&quot;
              });
  
  
  
              #endregion
              // Status List End
  
              if (obj == null)
              {
                  return NotFound();
              }
  
              obj.Ticket = _db.Tickets.FirstOrDefault(u =&gt; u.Ticket_Id == id);
              obj.StatusList = statusList;
  
  
              return View(obj);
  
          }
  
  </code></pre>
  <p><strong>My Post Controller performing Create / Update</strong></p>
  <pre><code>        // POST Create/Update
          [HttpPost]
          [ValidateAntiForgeryToken]
          public IActionResult Create(TicketVM obj)
          {
  
              if (obj.Ticket.Ticket_Id == 0)
              {
                  _db.Tickets.Add(obj.Ticket);
              }
              else
              {
                  _db.Tickets.Update(obj.Ticket);
              }
  
  
  
              _db.SaveChanges();
              return RedirectToAction(nameof(Index));
  
          }
  </code></pre>
  <p><strong>Here is my View</strong></p>
  <pre><code>@model WebApplication20.Models.TicketVM
  
  
  @{
  
      Layout = &quot;_Dashboard&quot;;
  
      var title = &quot;Create Ticket&quot;;
  
  }
  
  &lt;html&gt;
  
  &lt;body id=&quot;page-top&quot;&gt;
  
  
              &lt;!-- Main Content --&gt;
  
              &lt;form method=&quot;post&quot;&gt;
                  &lt;div class=&quot;row p-3 border&quot;&gt;
                      &lt;div asp-validation-summary=&quot;ModelOnly&quot; class=&quot;text-danger&quot;&gt;&lt;/div&gt;
                      &lt;input type=&quot;hidden&quot; asp-for=&quot;Ticket.Ticket_Id&quot; /&gt;
                      @if (Model.Ticket == null)
                      {
                          //edit
                          title = &quot;Create Ticket&quot;;
                      }
                      else
                      {
                          title = &quot;Update Ticket&quot;;
                      }
  
                      &lt;div class=&quot;col-12 border-bottom&quot;&gt;
                          &lt;h2 class=&quot;text-primary&quot;&gt;@title&lt;/h2&gt;
                      &lt;/div&gt;
                      &lt;div class=&quot;col-8 pt-4&quot;&gt;
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div class=&quot;col-4&quot;&gt;
                                  &lt;label asp-for=&quot;Ticket.TicketName&quot;&gt;&lt;/label&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;col-8&quot;&gt;
                                  &lt;input asp-for=&quot;Ticket.TicketName&quot; class=&quot;form-control&quot; /&gt;
                                  &lt;span asp-validation-for=&quot;Ticket.TicketName&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div class=&quot;col-4&quot;&gt;
                                  &lt;label asp-for=&quot;Ticket.TicketDescription&quot;&gt;&lt;/label&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;col-8&quot;&gt;
                                  &lt;textarea asp-for=&quot;Ticket.TicketDescription&quot; rows=&quot;5&quot; style=&quot;resize:none;&quot; class=&quot;form-control&quot;&gt;&lt;/textarea&gt;
                                  &lt;span asp-validation-for=&quot;Ticket.TicketDescription&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div class=&quot;col-4&quot;&gt;
                                  &lt;label asp-for=&quot;Ticket.TicketCreated&quot;&gt;&lt;/label&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;col-8&quot;&gt;
                                  &lt;input asp-for=&quot;Ticket.TicketCreated&quot; class=&quot;form-control&quot; /&gt;
                                  &lt;span asp-validation-for=&quot;Ticket.TicketCreated&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div class=&quot;col-4&quot;&gt;
                                  &lt;label asp-for=&quot;Ticket.Project_Id&quot;&gt;&lt;/label&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;col-8&quot;&gt;
                                  @Html.DropDownListFor(u =&gt; u.Ticket.Project_Id, Model.ProjectList, &quot;--Project List--&quot;,
  
                                      new { @class = &quot;form-control&quot; })
                                  &lt;span asp-validation-for=&quot;Ticket.Project_Id&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
  
                          &lt;!-- Status List--&gt;
  
                          &lt;div class=&quot;form-group&quot;&gt;
                              &lt;label asp-for=&quot;Ticket.TicketStatus&quot; class=&quot;col-md-2&quot;&gt;&lt;/label&gt;
                              &lt;div class=&quot;col-md-4 mx-auto&quot;&gt;
                                  &lt;select asp-for=&quot;Ticket.TicketStatus&quot; asp-items=&quot;@Model.StatusList&quot; class=&quot;form-control&quot;&gt;
                                      &lt;option disabeld selected&gt;
                                          --Select Status--
                                      &lt;/option&gt;
                                  &lt;/select&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;!-- Status List End--&gt;
  
  
  
                          &lt;div class=&quot;form-group row&quot;&gt;
                              &lt;div class=&quot;col-4 offset-4&quot;&gt;
                                  @if (Model.Ticket == null)
                                  {
                                      &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary form-control&quot;&gt;Create&lt;/button&gt;
                                  }
                                  else
                                  {
                                      &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary form-control&quot;&gt;Update&lt;/button&gt;
                                  }
                              &lt;/div&gt;
                              &lt;div class=&quot;col-4&quot;&gt;
                                  &lt;a asp-controller=&quot;Project&quot; asp-action=&quot;Details&quot; class=&quot;btn btn-success form-control&quot;&gt;Back to List&lt;/a&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
                
  
              &lt;/form&gt;
  
              &lt;!-- End of Main Content --&gt;
            
  
  </code></pre>
  <p><strong>Also shows my ViewModel for my view</strong></p>
  <pre><code>  public class TicketVM
      {
          public Ticket Ticket { get; set; }
  
          public Ticket Ticket_Id { get; set; }
  
          public IEnumerable&lt;SelectListItem&gt; ProjectList { get; set; }
  
          public IEnumerable&lt;SelectListItem&gt; StatusList { get; set; }
  
  
          public string TicketStatus { get; set; }
  
  
      }
  
  </code></pre>