且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在同一视图中使用多个模型

更新时间:2023-12-02 19:33:22





你可以创建一个包装类有两个成员类别和LIST < 子类别 >

,您可以在强类型视图中传递该类





http: //francorobles.wordpress.com/2011/05/03/returning-multiple-models-in-1-view-in-asp-net-mvc3/ [ ^ ]


使用部分视图在视图中渲染多个视图


Hi,

How to bind the view to multiple model classes in MVC 2 asp.net.


I have a requirements wherein,I need to prepare a view that is bound to two model classes, "Categories" and "SubCategories".

Thanks & Regards,
Raghu

hi ,

you can create a wrapper class which has two members Categories and LIST
<SubCategories>

,you can pass that class in strongly type view


http://francorobles.wordpress.com/2011/05/03/returning-multiple-models-in-1-view-in-asp-net-mvc3/[^]


Used partial views to render multiple views in a view