Determine the model of a partial view from the controller within MVC

前端 未结 5 1769
长情又很酷
长情又很酷 2020-12-13 10:12

My current problem is that I have a partial view that I want to determine what model is being used by it.

I have had to deal with a few strange scenarios for my pro

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 11:00

    What about a dynamic view model? Layouts in MVC3 use them, and maybe you can use something similar for your purposes:

    1. Dynamic in C# 4.0: Introducing the ExpandoObject
    2. Fun With Method Missing and C# 4
    3. Dynamic View Page, MVC without a View Model

提交回复
热议问题