MVC3 pass @model to partial view
问题 I have two partial views which are exactly the same, but for the @model. @model Project.Models.X @model Project.Models.Y How could I pass this model type to the view so that I can use the same view for both? 回答1: You can create a ViewModel Z, which passed to View. If you want to pass model X or Y, just passed that to Z then pass model Z to View. 回答2: Not sure if this is best practice, but you could also use HTML.RenderAction to call your controller and have it return a PartialViewResult with