Welcome to ASP.NET tutorial on Viewbag, ViewData and Tempdata.
Viewbag:
for sending data from controller to view, data destroys on redirection.
eg. ViewBag.message="something";
ViewData:
is also for sending data from controller to view, data destroys on redirection.
eg. ViewData["message"]="something";
TempData:
is also for sending data from controller to view, data does not destroys on redirection.
After one redirection data can be used and then data destroys.
eg. TempData["message"]="something";
Viewbag:
for sending data from controller to view, data destroys on redirection.
eg. ViewBag.message="something";
ViewData:
is also for sending data from controller to view, data destroys on redirection.
eg. ViewData["message"]="something";
TempData:
is also for sending data from controller to view, data does not destroys on redirection.
After one redirection data can be used and then data destroys.
eg. TempData["message"]="something";
For further details watch this video.
For online classes knock me at fb.com/ythecoder
For online classes knock me at fb.com/ythecoder
No comments:
Post a Comment