What are the roles and similarities between ViewData and ViewBag?

beingchinmay

New member
Joined
Jan 15, 2016
Messages
6
Points
1
  1. Maintains data when moving from controller to view.
  2. Passes data from the controller to the respective view.
  3. Their value becomes null when any redirection occurs, because their role is to provide a way to communicate between controllers and views. It's a communication mechanism within the server call.
 
Older Threads
Replies
11
Views
5,465
Replies
2
Views
3,378
Replies
16
Views
9,456
Replies
28
Views
15,798
Newer Threads
Replies
1
Views
2,851
Replies
2
Views
2,616
Replies
7
Views
5,575
Latest Threads
Recommended Threads
Replies
0
Views
1,977
Replies
5
Views
3,423
Replies
20
Views
10,410
Replies
3
Views
1,125
  • Locked
Replies
0
Views
3,532

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top