Create a parent view model that contains both models.
public class MainPageModel{
public Model1 Model1{get; set;}
public Model2 Model2{get; set;}
}
This way you can add additional models at a later date with very minimum effort.
More Related Contents:
- When do I use View Models, Partials, Templates and handle child bindings with MVC 3
- Why Two Classes, View Model and Domain Model?
- Escape @ character in razor view engine
- RequiredIf Conditional Validation Attribute
- Custom error pages on asp.net MVC3
- Using JSON.NET as the default JSON serializer in ASP.NET MVC 3 – is it possible?
- ASP.NET MVC3 – DateTime format
- How can I use a reportviewer control in an asp.net mvc 3 razor view?
- What is the @Html.DisplayFor syntax for?
- How Should I Declare Foreign Key Relationships Using Code First Entity Framework (4.1) in MVC3?
- Razor HtmlHelper Extensions (or other namespaces for views) Not Found
- MVC, EF – DataContext singleton instance Per-Web-Request in Unity
- Authorize attribute in ASP.NET MVC
- Checkbox for nullable boolean
- How to create custom editor/display templates in ASP.NET MVC 3?
- How to add extra namespaces to Razor pages instead of @using declaration?
- DropdownListFor default value
- Posting to a list MVC3
- Loading a partial view in jquery.dialog
- ASP.NET MVC 3: DataAnnotations.FileExtensionsAttribute not working
- Is it possible to display raw Html from database in ASP.NET MVC 3?
- jQuery Mobile/MVC: Getting the browser URL to change with RedirectToAction
- Razor comment syntax
- @Html.BeginForm Displaying “System.Web.Mvc.Html.MvcForm” on Page
- Parser Error: Server Error in ‘/’ Application
- Model binding comma separated query string parameter
- Ninject Binding Attribute to Filter with Constructor Arguments
- Could not load file or assembly ‘System.Data.Entity
- How to extend MVC3 Label and LabelFor HTML helpers?
- Correct way to bind an mvc3 radiobutton to a model