The well described model of View/Controller/Model is quite clear when it comes to object (say a book) update/delete/save etc., but how do you organize the common code such as populating drop down lists (from db)?
I use jQuery ajax to call control’s action, but in cases such as getting the arrays for drop down lists, I feel like these should not reside in the same BookController.
Can I have a Controller without the matching view for these purposes only?
Each
ViewModelis data for aViewto render. It sounds like you understand that. When Ajax calls for Data, I think it makes more sense for the controller for the view be responsible for creating anotherViewModeland returning it as Json for the rendered view. If mutliple views need to retrieve a list of Books, should call/Books/AjaxList(bad method name example), just like any view under/Books. Seperating the responsibility of creating aViewModelbased on Ajax or not Ajax doesn’t make sense to me.