Problem:
The name 'ViewBag' does not exist in the current context
Solution:-
You might be missing the
./Views/Web.config file, because you created the project from an empty ASP.NET application instead of using an ASP.NET MVC template. 
Nilesh ShahRank #42 · 34.2K reputationPosted Apr 13, 2017, 6:36 AM EDT