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
2,916
Replies
2
Views
1,875
Replies
14
Views
4,946
Replies
28
Views
7,312
Latest threads
Replies
1
Views
55
Replies
1
Views
57
Replies
1
Views
137
Replies
1
Views
165
Replies
1
Views
262
Recommended threads
Replies
13
Views
6,217
Replies
5
Views
3,141
Replies
4
Views
4,061

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

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