MVC 5 ViewBag security
问题 I am coding an MVC internet application, and I have a question in regards to using the ViewBag. In many of my controllers, I have SelectList objects, where the user can select an object. The object that is selected is a foreign key value for my model. My question is this: Should I use ViewBag for this? How secure is the ViewBag? Should I use values in my ViewModel instead of the ViewBag? Thanks in advance. 回答1: Use your view model. When the ViewBag was implemented (MVC 3) dynamic typing was