A design question on multiple DropDownLists on a View.
What is the best approach to displaying multiple DropDownLists on a View? Is it possible to pass multiple DropDownLists to a View model?
For example:
If I had the following View models: Student, Course, and Enrollment. And on the Index View page, I'm returning and displaying all students. But I'd like to filter the number of Students being returned based on values selected from multiple DropDownLists, such as Suburb, LanguageSpoken...
Each DropDownList will be populated from the database.
Two approaches that I can think:
In the Student View model, have a (fully populated) collection of Suburb, LanguageSpoken... .
Have multiple Models passed to the View model. In this case one Model will be a Student, and the other Models will be each DropDownLists. I haven't looked into the details of this yet.
I don't like the first approach, as it sounds very inefficient, i.e. each Student hold collections of list of all Suburbs, Languages... Also, not sure if the second approach is possible or even a good idea.
I'm using ASP.NET MVC 5 and Entity Framework 6.