---
title: "What is difference between ViewBag and ViewData in ASP.NET MVC?"  
description: "What is difference between ViewBag and ViewData in ASP.NET MVC?"  
author: "Chris Anderson"  
published: 2011-09-07  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/1212/what-is-difference-between-viewbag-and-viewdata-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 1 minute  

---

# What is difference between ViewBag and ViewData in ASP.NET MVC?

The basic difference between **ViewData** and **ViewBag** is that in ViewData instead creating dynamic properties we use properties of Model to transport the Model data in View and in ViewBag we can create dynamic properties without using Model data.

## Answers

### Answer by Chris Anderson

The basic difference between **ViewData** and **ViewBag** is that in ViewData instead creating dynamic properties we use properties of Model to transport the Model data in View and in ViewBag we can create dynamic properties without using Model data.


---

Original Source: https://www.mindstick.com/interview/1212/what-is-difference-between-viewbag-and-viewdata-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
