我在ViewBag元素中设置了一个位置列表,如下所示:
    public ActionResult Create()
    {
        var db = new ErrorReportingSystemContext();
        IEnumerable<SelectListItem> items = db.Locations
          .AsEnumerable()
          .Select(c => new SelectListItem
          {
              Value =c.id.ToString(),
              Text = c.location_name
          });
        ViewBag.locations = items;
        return View();
    } 
我试图从这样的视图中获取 ViewBag.locations 的值
    @Html.DropDownListFor(model => model.location_fk_id, ViewBag.locations);
    //@Html.DropDownListFor(model => model.location_fk_id, @ViewBag.locations);
    //@Html.DropDownListFor(model => model.location_fk_id, "locations");
但无济于事。我该如何使用它?