It uses the C# 4.0 dynamic feature. It achieves the same goal as viewdata and should be avoided in favor of using strongly typed view models (the same way as viewdata should be avoided).
So basically it replaces magic strings:
ViewData["Foo"]
with magic properties:
ViewBag.Foo
for which you have no compile time safety.
I continue to blame Microsoft for ever introducing this concept in MVC.
The name of the properties are case sensitive.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…