title: MVC Passing List to View Issue
body: <p>I have a list in the controller as follows:</p>
  
  <pre><code>    public class TruckData
      {
         public string Truck{ get; set; }                        
      }
  
  
       var truckdat = (from p in KowaDataContext.tblTrucks
                       orderby p.Truck
                       select new TruckData {Truck= p.Truck});
  
  
       var trucklist = truckdat.ToList();
  
       ViewBag.TrckList= trucklist;
  </code></pre>
  
  <p>The View looks like the following:</p>
  
  <pre><code>    @foreach (Data.Rep.Controllers.TruckController.TruvckData item in ViewBag.TrckList)         
      {
       &lt;tr&gt;        
  
        &lt;td&gt;
           @item.Truck
        &lt;/td&gt;
     &lt;/tr&gt;      
  
     }
  </code></pre>
  
  <p>My question is, how can I pass the list to the view without using the class:</p>
  
  <pre><code>     public class TruckData
      {
           public string Truck{ get; set; }                        
      }
  </code></pre>
  
  <p>so that my list looks like the following: Notice how the reference to TruckData is gone below:</p>
  
  <pre><code>    var truckdat = (from p in KowaDataContext.tblTrucks
                         orderby p.Truck
                         select new {Truck= p.Truck});
  
       var trucklist = truckdat.ToList();
  
       ViewBag.TrckList= trucklist;
  </code></pre>
  
  <p>I am not sure how the foreach in the view will look like. I tried what is shown below but was giving me a problem. </p>
  
  <pre><code>  @foreach (var item in ViewBag.TrucksSelectList) 
  </code></pre>