-ViewData is a dictionary object in which we can store the data. The data then will be accessed from the view.
-ViewData is derived from the ViewDataDictionary class and we can use the traditional "key-value" syntax.
-The ViewBag object act as a wrapper around the ViewData object.
-By using ViewBag we can create dynamic properties for the ViewBag.
Hi dinkey,
Refer the below article.
ASP.Net MVC: ViewData, ViewBag and TempData Similarities and Differences with examples
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.