Exploring the online world is my passion. have experience of #content writing #SEO #Digital Marketing #On-Page #Lead Generation #Content Analyst #Marketing Analyst... I could never stop at one point, continuously wanted to acquire more and more skills. My work for any organization will be full of passion and hard work.
ViewData and ViewBag are almost similar,and TempData carry out additional responsibility.
The main difference between ViewBag and ViewData is, ViewBag is a dynamic property that takes benefit of the new dynamic features in C# 4.0. And ViewData is a dictionary of objects that is derived from ViewDataDictionary class and is attainable using strings as keys.
Now we Discuss about TempData,
TempData helps to maintain data when you move from one controller to other controller or from one action to other action. TempData internally uses session variables.
Liked By
Write Answer
What is difference between ViewData, ViewBag and TempData?
Join MindStick Community
You have need login or register for voting of answers or question.
Hemant Patel
14-Dec-2017ViewData and ViewBag are almost similar,and TempData carry out additional responsibility.
The main difference between ViewBag and ViewData is, ViewBag is a dynamic property that takes benefit of the new dynamic features in C# 4.0. And ViewData is a dictionary of objects that is derived from ViewDataDictionary class and is attainable using strings as keys.
Now we Discuss about TempData,
TempData helps to maintain data when you move from one controller to other controller or from one action to other action. TempData internally uses session variables.