Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

hi ,

you can create a wrapper class which has two members Categories and LIST
HTML
<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/[^]
 
Share this answer
 
v3
Used partial views to render multiple views in a view
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900