Difference between ( ViewData,TempData, ViewBag,Session) in asp.net mvc c# Hindi/Urdu | M-Tech Sol

preview_player
Показать описание
In this MVC ( Model view controller) video we will try to understand what is the difference between viewdata,viewbag,tempdata and session.This is an interesting MVC interview question and below is a textual answer for the same.
#mvctutorial #aspdotnetmvc5tutorial #MVC #ViewData #ViewBag #TempData
#default
#index
Temp data: - Helps to maintain data when you move from one controller to other controller or from one action to other action. In other words when you redirect, "tempdata" helps to maintain data between those redirects. It internally uses session variables.

View data: - Helps to maintain data when you move from controller to view.

View Bag: - It's a dynamic wrapper around view data. When you use "Viewbag" type casting is not required.
Рекомендации по теме
Комментарии
Автор

I just watched through this video. According to theory explanation . TempData demo for data transfer from one controller to another is not explained. Also please show how session is used to store data at browser end.

The rest of the explanations given are good and appreciable.

razzverma