How do I add a DropDownList in a Create view populated by a query from another Controller using .NET MVC and C#?
Posted on 2011-02-16
I'm very new to .NET, C# and MVC in general, so I'm not quite sure how to handle this simple task...
I'm using MVC 3 and C# with my ASP.NET framework.
I have two Controllers right now. Say, CarListController.cs and CarMakeController.cs. I used the built-in 'View' creator to show a List of the Cars that is built in the 'CarList.cs' Model. This also built a link to the 'Create' page that I then built using this same technique.
Now, it works great for just typing in the Car Name, Car Model and Car Make, but I would like the Car Make to be a DropDownList that is populated with data from another table that I have. That table was built using the CarMakeController.cs Controller and CarMake.cs Model.
I would just like to bind a DropDownList to the values in another table in my Database for use on that create page.
Thank you very much in advance and please let me know if you need me to clarify!!!!!!!!!