- With ViewBag (dynamic type):
- Action: ViewBag.Message = "Hello World!";
- View: @ViewBag.Message
- With ViewData (dictionary)
- Action: ViewData["message"] = "Hello World!";
- View: @ViewData["message"]
- With Strongly-typed views:
- Action: return View(model);
- View: @model ModelDataType;
Created
November 3, 2017 07:52
-
-
Save M-Yankov/fc15ddb0e54ac3667835e627f6df1498 to your computer and use it in GitHub Desktop.
Differences between ViewBag, ViewData and model
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment