title: ASP.Net MVC Strongly Typed View With Multiple Models
body: <p>I have a controller which peforms a linq to sql query against a model consiting of 4 tables.</p>
  
  <pre><code> var files = from f in filesContext.Files
                      join u in filesContext.aspnet_Users on f.Uploader equals u.UserId
                      join uir in filesContext.aspnet_UsersInRoles on u.UserId equals uir.UserId
                      join ur in filesContext.aspnet_Roles on uir.RoleId equals ur.RoleId
                      select f;
  </code></pre>
  
  <p>I then return the view passing files variable as the model.</p>
  
  <p>In the view I currently have:</p>
  
  <pre><code>Inherits="System.Web.Mvc.ViewPage&lt;IEnumerable&lt;Bailiffs.Models.File&gt;&gt;"
  </code></pre>
  
  <p>This is fine until I want to access columns from any other table except Files e.g. aspnet_Users or aspnet_Rols. I guess this is because my view knows nothing of those models. How can i gain access to those models in my view?</p>