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,599
Replies
2
Views
3,445
Replies
16
Views
9,650
Replies
28
Views
16,281
Newer Threads
Replies
1
Views
2,901
Replies
2
Views
2,667
Replies
7
Views
5,644
Latest Threads
Replies
1
Views
143
Replies
1
Views
127
Replies
2
Views
789
Recommended Threads
Replies
15
Views
15,666
Replies
13
Views
10,443
Replies
0
Views
2,703
Replies
4
Views
4,343

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