Sunday, May 13, 2012

What is difference between Viewbag and Viewdata in ASP.NET MVC?

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.

4 comments:

  1. As such purpose of both Viewbag and Viewdata is same, it allows developers to pass data from controllers to views but still it's good to know about this basic difference too.

    ReplyDelete
  2. Its just like you read my ideas! You gaze to know a good deal relevant for this, just like you written it within it or something like that like this. In my opinion you could utilize a few photos to operate a vehicle the information home just a little, but aside from that, this can be great blog. A great read. I'll certainly return.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. That's the one line basic difference between "Viewbag and Viewdata" nice article.

    ReplyDelete