In an ideal "hello world," you need to pass a strongly typed model back to the view.
return View(MyModel);
If everything gets sticky, we can create
ViewModel
return View(MyViewModel);
ex.
Myviewmodel
I can avoid creating the whole ViewModel
and partially use ViewBag.
ViewBag.Foo = Foo;
return View(MyModel);
I understand that I will lose some strongly typed functions
(e.g. Intellisense)
in my view for this ViewBag.
Is this approach sloppy? vs MVC mean?
If so, what is the actual ViewBag point?
Pinch source
share