I want to access Asp.net Mvc's ViewBag object from other class library's class. Is it impossible or impossible to access?
I have tried to write System.Web.Mvc.ViewBag
in other Class library's class but ViewBag hasn't come after System.Web.Mvc
ViewBag persists within the life time of request.
So you can't use it in other class Library as it is available of the particular request. It’s life lies only during the current request.
If redirection occurs then it’s value becomes null.
Here is well explained blog http://www.rachelappel.com/when-to-use-viewbag-viewdata-or-tempdata-in-asp.net-mvc-3-applications