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
4,164
Replies
2
Views
2,740
Replies
16
Views
7,433
Replies
28
Views
10,836
Newer Threads
Replies
1
Views
2,302
Replies
2
Views
2,183
Replies
7
Views
4,373
Latest Threads
Replies
1
Views
26
Replies
0
Views
188
Replies
1
Views
40
Replies
2
Views
83
Recommended Threads
Replies
15
Views
7,704
Replies
7
Views
2,568
Replies
5
Views
2,840
Replies
2
Views
2,413

Latest postsNew threads

Latest Hosting OffersNew Reviews

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