Is ViewData the new standard over ViewBag for ASP.Net 5 (core)?
问题 I have noticed that in all the examples and tutorials on ASP.Net 5 (core) I have seen from Microsoft and the default Web Application template in VS 2015 use @ViewData["XXX"] instead of @ViewBag.XXX . Is this the, now, recommended way of passing data up from the controller instead of ViewBag ? I know that ViewBag is a wrapper for ViewData but in the old tutorials (ASP.NET 4.5) they use ViewBag . If they are now encouraging developers to use ViewData why the change? 回答1: Both are still valid.