Part 5- Difference between ViewBag and Viewdata and TempData | Peak and Keep
Overview:
In this video you can practically distinguish the ViewBag , ViewData and TempData .This question is very common in every interview so be prepared for this .
It is notable if any redirection occurs then viewbag and viewdata value gets null but tempData value get preserved if and only if tempData.Keep() method is being used.
SOCIAL :
Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam
Follow us on Twitter : @technotipsMVC
VISIT OUR BLOG:
http://technotipstutorial.blogspot.com
INTRODUCTION :
ViewData and ViewBag
Used to pass data from controller to corresponding view.
ViewData is a dictionary of objects that is derived from ViewDataDictionary class and is accessible using strings as keys.
ViewBag is a dynamic container.
ViewData requires typecasting for complex data type and check for null values to avoid error.
ViewBag doesn’t require typecasting for complex data type.
Ex : ViewBag.MyName=“Ashish” , ViewData[“MyName”]=“Ashish"
TempData:
TempData is also a dictionary object derived from TempDataDictionary class and stored in short lives session
It helps to maintain data when you move from one controller to other controller or from one action to other action
Ex : TempData[“MyName”]=“Ashish”
TAGS :
how to create a - website
asp. net mvc
asp.net mvc interview questions
asp .net mvc tutorial
asp. net mvc 4
asp.net mvc 5 tutorial
asp net mvc developer
asp net mvc continuous integration
asp net mvc hosting
model view controller
jquery-ajax
$ ajax jquery
jquery ajax tutorial
viewbag
$controller
$model
razor view engine
$how to get rich
Видео Part 5- Difference between ViewBag and Viewdata and TempData | Peak and Keep канала Technotips Ashish
In this video you can practically distinguish the ViewBag , ViewData and TempData .This question is very common in every interview so be prepared for this .
It is notable if any redirection occurs then viewbag and viewdata value gets null but tempData value get preserved if and only if tempData.Keep() method is being used.
SOCIAL :
Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam
Follow us on Twitter : @technotipsMVC
VISIT OUR BLOG:
http://technotipstutorial.blogspot.com
INTRODUCTION :
ViewData and ViewBag
Used to pass data from controller to corresponding view.
ViewData is a dictionary of objects that is derived from ViewDataDictionary class and is accessible using strings as keys.
ViewBag is a dynamic container.
ViewData requires typecasting for complex data type and check for null values to avoid error.
ViewBag doesn’t require typecasting for complex data type.
Ex : ViewBag.MyName=“Ashish” , ViewData[“MyName”]=“Ashish"
TempData:
TempData is also a dictionary object derived from TempDataDictionary class and stored in short lives session
It helps to maintain data when you move from one controller to other controller or from one action to other action
Ex : TempData[“MyName”]=“Ashish”
TAGS :
how to create a - website
asp. net mvc
asp.net mvc interview questions
asp .net mvc tutorial
asp. net mvc 4
asp.net mvc 5 tutorial
asp net mvc developer
asp net mvc continuous integration
asp net mvc hosting
model view controller
jquery-ajax
$ ajax jquery
jquery ajax tutorial
viewbag
$controller
$model
razor view engine
$how to get rich
Видео Part 5- Difference between ViewBag and Viewdata and TempData | Peak and Keep канала Technotips Ashish
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![सपने में पापा ने मारा हैरी को 😂 🤣 #shorts #youtubeshorts #funny #laugh #foryou #trending #viral](https://i.ytimg.com/vi/ayFSsTS6daI/default.jpg)
![Part 15 - Jquery Effects - #Fading effects | fadeIn, fadeOut, fadeToggle and fadeTo method](https://i.ytimg.com/vi/v8athq6qZZc/default.jpg)
!["Journey to Tranquility: Exploring the Sheikh Zayed Grand Mosque, Abu Dhabi" | vLog #4](https://i.ytimg.com/vi/WkhjsxBulaQ/default.jpg)
![Mr Harry copycat 😂😘](https://i.ytimg.com/vi/zPJHBpVnqjs/default.jpg)
!["Discover the Speed of Dreams: Ferrari World Abu Dhabi | Ultimate Adventure!" | VLog #3](https://i.ytimg.com/vi/Ji7MfiqSU6U/default.jpg)
![I just found an amazing creature 🥸 #creature #insects](https://i.ytimg.com/vi/iISRqlYFHVU/default.jpg)
![Exploring Corniche Beach, Abu Dhabi | VLog #5](https://i.ytimg.com/vi/-1_vQoL0Va8/default.jpg)
![Mr Harry taking medicines 🤣](https://i.ytimg.com/vi/5ZXotJ7YKbI/default.jpg)
![Part 3 - What are jQuery Selectors? | ID and class selectors | Example](https://i.ytimg.com/vi/Qh8Gk-NKVuc/default.jpg)
![Part 8 - Jquery Events - #Document and Windows Events| load, resize, and scroll methods](https://i.ytimg.com/vi/Mxxa7aXQe7Q/default.jpg)
![Never ending love ❤️ #marriage #love #neverendinglove #lovestory](https://i.ytimg.com/vi/nL9JMRfOrpI/default.jpg)
![Part 6 C# tutorial - Nullable Type | Null Coalescing Operator??](https://i.ytimg.com/vi/XCq5M0fvP6Q/default.jpg)
![Part 1 - What is JQuery | Create your first JQuery project | Step by Step tutorial](https://i.ytimg.com/vi/hq3AtjlAjgw/default.jpg)
![DUBAI, United Arab Emirates Cinematic Video shot on APPLE iPhone 15 Pro Max | 1080p](https://i.ytimg.com/vi/xF-niKrs7Fs/default.jpg)
![नाराज़ कुत्ते को ये sound सुना दो बस #dogs #shorts #viral #trending #dogsound #dogfavoritemusic](https://i.ytimg.com/vi/DNeM3o81pR4/default.jpg)
![Kore K-8in1 Decline Bench | Kore PVC dumbbells | MTN FITNESS 5 ft Straight Rod & 3ft Curl Rod](https://i.ytimg.com/vi/iC2vug8oLFo/default.jpg)
![HOW TO MAKE PAV BHAJI AT HOME | बाजार जैसी पाव भाजी बनाने की रेसिपी| Pav bhaji Recipe| Hindi](https://i.ytimg.com/vi/lgELxY38Ut8/default.jpg)
![Comment your next destination? #travel #exploreworld #shorts #zindaginamilegidobara](https://i.ytimg.com/vi/zNbzjdzgMCg/default.jpg)
![Part 10 - Jquery Traversing - #Parent Element Traversal | parent, parents and parentsUntil methods](https://i.ytimg.com/vi/kCMLArlByJ4/default.jpg)
![Dubai view from metro❤️](https://i.ytimg.com/vi/ol4M7yUVoLY/default.jpg)
![Part 4 - How to use various Data Types in Angular 5 | TypeScript Data Types](https://i.ytimg.com/vi/OtMdvzOS_hw/default.jpg)