In This Article,
I would like to know you about the Use Of ViewBag In MVC Application.
Actually ViewBag
is a dynamic property, which is used to pass data from Controller To
Corresponding View. And It Is The Wrapper Of ViewData i.e., ViewBag uses
ViewData Internally And ViewData Is Derived From Dictonary Class Called
ViewDataDictionary. The Life Of ViewData Is Only Lies In Current Request,But If
Redirection Occurs, Then It’s value becomes null. And It Does Not Require
Typecasting. So It Is Slower Than ViewData.