title: Passing data from the controller to the view in asp.net
body: <p>I'm currently developping a website on asp.net MVC 4. 
  I'm a bit confused about the different ways to pass data from the controller to the view.</p>
  
  <p>First of all, if we have a list of objects users, what's the difference between passing this list to the view using:</p>
  
  <pre><code>return View(users);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>ViewBag.users = users;
  </code></pre>
  
  <p>My other question is about the first solution.
  If we use this solution, do we have to use this</p>
  
  <pre><code>@model IEnumerable&lt;mydb.users&gt;
  </code></pre>
  
  <p>in the View?</p>
  
  <p>Or could we use for instance</p>
  
  <pre><code>@model IEnumerable&lt;mydb.registrations&gt;
  </code></pre>
  
  <p>I know it would be odd to use a different model in the view than what we've used in the controller, but VS doesn't seem to be bothered.</p>
  
  <p>Thanls a lot for you answers</p>