I am using a user dropdown which comes in most of add/edit pages which comes from database. Right now in all actions, I am getting the users in a viewbag and creating dropdown in the view. Is this the right way? Can someone help me in a way I can call one usercontrol and the dropdown is created with proper name and value. Or can someone suggest what is the right method.
Share
What you should do, is create a base ViewModel class, which contains the values for the dropdown. Than let all other ViewModels inherit from the base class.
Than create an ActionFilter that fills the DropdownMenu Items list. The _Layout view should have the dropdown in it.
Here is a working solution