What are the roles and similarities between ViewData and ViewBag?

beingchinmay

New member
Joined
Jan 15, 2016
Messages
6
Points
0
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
8
Views
4,497
Replies
2
Views
2,686
Replies
14
Views
8,610
Replies
28
Views
13,315
Latest threads
Replies
2
Views
172
Replies
1
Views
152
Recommended threads
Top