MVC Video :- Difference between viewdata,viewbag,tempdata and session.(MVC Interview questions)

  Рет қаралды 277,482

.NET Interview Preparation videos

.NET Interview Preparation videos

11 жыл бұрын

Buy full MVC 5 & MVC CORE course from here www.questpond.com/learn-mvc-5...
For more such videos visit www.questpond.com
For more such videos subscribe kzbin.info...
See our other Step by Step video series below :-
Learn C# Step by Step goo.gl/FNlqn3
Learn Design Pattern Step by Step:- goo.gl/eJdn0m
Learn Angular tutorial step by step tinyurl.com/ycd9j895
Learn MVC Core step by step :- tinyurl.com/y9jt3wkv
Learn Azure Step by Step :- tinyurl.com/y6fmrech
Learn SharePoint Step by Step in 8 hours:- goo.gl/XQKHeP
Python Tutorial for Beginners:- • Python Tutorial for Be...
Learn Data Science in 1 hour :- tinyurl.com/y5o7qbau
Learn Power BI Step by Step:- tinyurl.com/y6thhkxw
Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
Learn SQL Server Step by Step tinyurl.com/ja4zmwu
Learn Tableau step by step :- tinyurl.com/kh6ojyo
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.
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.
Want to Learn MVC 5 in 2 days start from the below video :-
goo.gl/1br5mb
The following syllabus has been covered in Learn MVC 5 in 2 days
Learn MVC 5 in 2 days
Lab 1 : - Simple Hello world(20 Minutes)
Lab 2 : - Explain MVC Routing(10 Minutes)?
Lab 3 : - Explain ViewData, ViewBag, TempData & Session Variables?(20 Minutes)
Lab 4 :- Explain Model and Strongly typed views (20 minutes)?
Lab 5 : - Explain Model Binders(10 minutes)?
Lab 6 :- Why MVC and MVC vs Webforms ? (30 minutes)
Lab 7 :- Explain TempData , Peek and Keep ? (10 Minutes)
Lab 8 : - Explain Data Annotations and HTML Helpers classes?(31 Minutes)
Lab 9 : - What is the need of ViewModel in MVC? (10 Minutes)
Lab 10 : - How can we use Entity Framework in MVC?(20 minutes)
Lab 11 : - How to implement viewmodel, partial view and webgrid?(45 minutes)
Lab 12 : - What is the difference between ActionResult and ViewResult in MVC?(10 minutes)
Lab 13 :- How to implement Ajax using Json and Jquery in MVC ? (60 Minutes)
Lab 14 : - What is the use of Async Controllers in MVC?(20 minutes)
Lab 15 :- How to deploy MVC Application on IIS ? (10 minutes)
Lab 16 :- How can we do Windows and Forms Authentication in MVC? (50 Minutes)
Lab 17 : - How can we use MVC areas for better modular development ? (10 Minutes)
Lab 18 :- How to implement MVC with Angular ? (60 minutes) ?
Lab 19 :- Can we Overload MVC Action methods ? (10 Minutes)
Lab 20 :- How to improve Reusability using Angular ? (20 Minutes) ?
Lab 21 :- What is the need of WebAPI in MVC ? (30 Minutes)
Lab 22 : - How to do exception handling in MVC? (30 Minutes)
Lab 23 :- How to do update and delete using MVC , WebAPI , EF and Angular? (30 Minutes)
Lab 24 : - How to use MVC Webgrid?(30 minutes)
Lab 25 :- How to implement Validation using Angular and MVC (30 minutes)?
Lab 26 :- What is SPA (Single page application)?
Lab 27 :- How to Organize MVC project and Understanding CORS issue ? (42 minutes)
Lab 28 :- Explain the importance of DisplayModes ? (10 minutes)
Lab 29 :- How to do unit testing with MVC projects (30 minutes)?
Lab 30 :- How to implement SPA using Angular Routing ?
Lab 31 :- How to create decoupled systems using MVC DI ?
Lab 32 :- How can we have multiple submit buttons in ASP.NET MVC ?
Lab 33 : - What is the importance of AntiForgery in MVC?
Lab 34 :- What is the importance of ValidateInput and AllowHTML in MVC?
Lab 35:- Bundling and Minification(15 minutes)
Lab 36 :- Layout pages in Razor
Lab 37: - What are ActionFilters in MVC?
Lab 38: - What is WebAPI (Theory)?
Lab 39: - How can we create and consume WEB API (Practical)?
Lab 40 :- MVC 6/ASP.NET Core Training-Part 1 (2 Hours).
Visit us at www.questpond.com for more details
We are also distributing a 100 page Ebook "ASP.NET MVC". If you want this ebook please share this video in your facebook/twitter/linkedin account and email us on questpond@questpond.com with the shared link and we will email you the PDF.

Пікірлер: 74
@dnfvideo
@dnfvideo 2 жыл бұрын
Do not miss our Interview Question video series 25 Important ASP.NET Interview Questions : kzbin.info/www/bejne/ponQfpejf7p2Zsk 30 Important C# Interview Questions : kzbin.info/www/bejne/eHzcn3h4hdacf68 25 Angular Interview Questions : kzbin.info/www/bejne/Y5vIoKx6f6mmia8 5 MSBI Interview Questions : kzbin.info/www/bejne/a3abYmiXjaaqj7M
@praveendubey1994
@praveendubey1994 9 жыл бұрын
Thanks , Awesome, Short, Simple and helps to understand exactly what is needed.
@monsieurrodriguez9687
@monsieurrodriguez9687 11 ай бұрын
you didn't test the same name in the viewbag controllers communication example, at minute eleven, you put ViewBag.CurrentDateTime while actually it was named ViewBag.CurrentDateANDTime. Anyway, thanks for the video, the point was explained successfully
@bjblk1
@bjblk1 8 жыл бұрын
Excellent video. Thank you very much. I will eventually watch all of your videos.
@dpkbahuguna
@dpkbahuguna 11 жыл бұрын
The session is very descriptive and informative to set the basics of MVC. Thanks...Keep posting the Training :-)
@amishkumar5320
@amishkumar5320 10 жыл бұрын
enjoyed alot with your videos keep good works on thanks
@wase39
@wase39 10 жыл бұрын
very simple and elegant lesson
@TubaMirza-co7ql
@TubaMirza-co7ql 2 ай бұрын
11 years old video waw .. still knowledgeable
@mohamedsaied5780
@mohamedsaied5780 6 жыл бұрын
Good video and good explanation regardless the small mistakes.
@manishkjanu
@manishkjanu 11 жыл бұрын
Very useful information. Thanks!
@JayadevNelli
@JayadevNelli 7 жыл бұрын
Very good video, thank you for posting.
@CodeSbyAniz
@CodeSbyAniz 3 жыл бұрын
Great Job. Thanks for the video
@coolayer
@coolayer 11 жыл бұрын
Thanks Brother! It was very helpful.
@MrSanjdhi
@MrSanjdhi 11 жыл бұрын
nice efforts for beginners and all. Keep it up.
@theUnboxerfalcon
@theUnboxerfalcon 6 ай бұрын
Thank you for a brilliant video..
@fcinternetmarketing
@fcinternetmarketing 10 жыл бұрын
Love this video.
@TheAsimiy
@TheAsimiy 10 жыл бұрын
Very nice tutorial .... thanks Sir
@218manish
@218manish 10 жыл бұрын
Nice & useful Tutorial
@ims4666
@ims4666 3 жыл бұрын
Awesome explanation....
@talalshoaib3099
@talalshoaib3099 8 жыл бұрын
Very nice video thank you sir :)
@bhuvanatn
@bhuvanatn 11 жыл бұрын
Thanks very much..very helpful
@RaviHandsome
@RaviHandsome 10 жыл бұрын
Example is incorrect though concept is right. CurrentDateAndTime and CurrentDateTime are different at 12:20
@rprabhuit
@rprabhuit 10 жыл бұрын
wrong statement on TempData usage. TempData can be used from controller to view as well. The TempData will be reset to null, only after it was read or used. But we can keep the data's in TempData after read by calling TempData.Keep() function. The Keep() should be called immediately after TempData object used.
@prateekbhardwaj9943
@prateekbhardwaj9943 8 жыл бұрын
+Prabhu Raja Exactly i was thinking the same.. but every where i read this that tempdata for controller to controller ... ? is it true for mvc 3? or in mvc 4 we can use controller to view (one cycle)
@nimitjoshi8639
@nimitjoshi8639 8 жыл бұрын
I have worked on MVC 5 project and in that i have used TempData to pass the info from Controller to View.
@mohamedsaied5780
@mohamedsaied5780 6 жыл бұрын
msdn.microsoft.com/en-us/library/system.web.mvc.tempdatadictionary(v=vs.118).aspx You can use a TempDataDictionary object to pass data in the same way that you use a ViewDataDictionary object. However, the data in a TempDataDictionary object persists only from one request to the next, unless you mark one or more keys for retention by using the Keep method. If a key is marked for retention, the key is retained for the next request. A typical use for a TempDataDictionary object is to pass data from an action method when it redirects to another action method. For example, an action method might store information about an error in the controller's TempData property (which returns a TempDataDictionary object) before it calls the RedirectToAction method. The next action method can then handle the error and render a view that displays an error message.
@rohanthakur6136
@rohanthakur6136 6 жыл бұрын
Excellent video sir. Thank you very much. how to get MVC Asp.Net Q & A Series.
@Robsonsantosxd
@Robsonsantosxd 9 жыл бұрын
Could anyone send the link of the next lesson ? i couldn't find it. Great Lesson BTW!
@tsogiaidze
@tsogiaidze 9 жыл бұрын
Great!
@manoharjulakanti8688
@manoharjulakanti8688 7 жыл бұрын
hi sir, i used temp data in view and also in action method ...then also data is transferring from action method to view.....
@rohitashkumar7765
@rohitashkumar7765 8 жыл бұрын
Nice video
@VannaraLoch
@VannaraLoch 10 жыл бұрын
but your two viewBag variable is not the same...one is CurrentDateAndTime one is CurrentDateTime
@kashyapkaki2377
@kashyapkaki2377 6 жыл бұрын
Exactly! Same doubt here.
@dnfvideo
@dnfvideo 11 жыл бұрын
Sorry it was my mistake to type the wrong property name.
@rohitshinde8145
@rohitshinde8145 4 жыл бұрын
helpful ty.
@SultanAhmed-xx1oz
@SultanAhmed-xx1oz 2 жыл бұрын
THank YUo
@ARV-sf5td
@ARV-sf5td 5 жыл бұрын
What is the difference between tempdata keep and peek
@arunvenkatesh6464
@arunvenkatesh6464 5 жыл бұрын
PLS MAKE VIDEO ON CASCADING DROP DOWN LIST LOAD DATA FROM DATABASE AND SAVE DATA TO DATATBASE
@bhaktilife111
@bhaktilife111 Жыл бұрын
So beautiful
@chandanadas7860
@chandanadas7860 4 жыл бұрын
tempdata is controller to controller and also controller to view
@92_shwetadhande92
@92_shwetadhande92 11 ай бұрын
sir please provide link of how to pass data from view to controller?
@akshaygaikwad817
@akshaygaikwad817 9 жыл бұрын
you have given wrong viewbag name in sampleview1 while geting its data in string varible and shown null value
@shailabgupta8746
@shailabgupta8746 8 жыл бұрын
+akshay gaikwad, yes i also caught this problem
@nimitjoshi8639
@nimitjoshi8639 8 жыл бұрын
Yes. I was thinking about to mention it. But i saw your comment which is related to this. +1
@Nandakishore48
@Nandakishore48 7 жыл бұрын
yaa dude you are right
@mohamedsaied5780
@mohamedsaied5780 6 жыл бұрын
yes, CurrentDateAndTime while in another CurrentDateTime but it will lead to null also if he typed it correct as viewbag cann't transfer data between controllers
@knowledgeys6652
@knowledgeys6652 5 жыл бұрын
I believe Tempdata sends the data from one view to other View..
@odytrice
@odytrice 10 жыл бұрын
You can also pass TempData to the View
@sinchanar440
@sinchanar440 5 жыл бұрын
Sir, I have a question please give me a reply. How do I set session for multiple user login and I want to differentiate as Admin and local user...
@RanjeetKumar-gg7ie
@RanjeetKumar-gg7ie 4 жыл бұрын
through authorization differentiate between admin & local user , also set HttpContext.Current.Session.Timeout = x ,( x is time ) to set diff timeout as per user accessibility..
@RanjeetKumar-gg7ie
@RanjeetKumar-gg7ie 4 жыл бұрын
Create a master base class inherit it on master page if you are storing information in session about user type and write a function if(Session["admin"] !=null){ if(Session["admin"].ToString() == "True") { HttpContext.Current.Session.Timeout = 120; }if(Session["user"].ToString() == "True") {HttpContext.Current.Session.Timeout = 60; }else {HttpContext.Current.Session.Timeout = 30;} } or you can replace session with profile if you are using profile
@amruthbinish
@amruthbinish 11 жыл бұрын
how can we create mvc views faster and make them strong typed by using html helper ---where this video?
@akashverma1640
@akashverma1640 2 жыл бұрын
Sir at 12:07 you have used wrong name of variable in viewbag i.e viewbag.CurrentDateTime instead of Viewbag.CurrentDateAndTime that is why it's null.
@prateekbhardwaj9943
@prateekbhardwaj9943 6 жыл бұрын
you should correct the information, this is a very old video. controller to view is possible in tempdata aslo
@NeelanjanaDutta
@NeelanjanaDutta 7 жыл бұрын
I cannot see any view engine drop down list in the add view page. so I cannot open aspx view. kindly suggest.
@dnfvideo
@dnfvideo 7 жыл бұрын
Please mail us your query at questpond@questpond.com
@sameerkhatri1918
@sameerkhatri1918 6 жыл бұрын
If you get the solution please let me know or you can send me an email on ersameer.khan05@gmail.com
@balaram438
@balaram438 9 жыл бұрын
thanks you so much it was nice explanation
@sujanvaland
@sujanvaland 10 жыл бұрын
its not that we tempdata is not maintain from Controller to View, we can maintain the data
@niteshkr.upadhyay3506
@niteshkr.upadhyay3506 3 жыл бұрын
Is it really wrong? At 11:17 he added a value in ViewBag.CurrentDateAndTime but was receiving with ViewBag.CurrentDateTime That's wrong na? How will it fetch the value?
@ragavaragala9116
@ragavaragala9116 4 жыл бұрын
In action method samlpeview you mentioned current dateandtime but second action method you mentioned current datetime you don't mentioned and
@dnfvideo
@dnfvideo 9 жыл бұрын
Want to Learn MVC 5 in 2 days start from the below video :- goo.gl/1br5mb The following syllabus has been covered in Learn MVC 5 in 2 days Learn MVC 5 in 2 days Lab 1 : - Simple Hello world(20 Minutes) Lab 2 : - Explain MVC Routing(10 Minutes)? Lab 3 : - Explain ViewData, ViewBag, TempData & Session Variables?(20 Minutes) Lab 4 :- Explain Model and Strongly typed views (20 minutes)? Lab 5 : - Explain Model Binders(10 minutes)? Lab 6 :- Why MVC and MVC vs Webforms ? (30 minutes) Lab 7 :- Explain TempData , Peek and Keep ? (10 Minutes) Lab 8 : - Explain Data Annotations and HTML Helpers classes?(31 Minutes) Lab 9 : - What is the need of ViewModel in MVC? (10 Minutes) Lab 10 : - How can we use Entity Framework in MVC?(20 minutes) Lab 11 : - How to implement viewmodel, partial view and webgrid?(45 minutes) Lab 12 : - What is the difference between ActionResult and ViewResult in MVC?(10 minutes) Lab 13 :- How to implement Ajax using Json and Jquery in MVC ? (60 Minutes) Lab 14 : - What is the use of Async Controllers in MVC?(20 minutes) Lab 15 :- How to deploy MVC Application on IIS ? (10 minutes) Lab 16 :- How can we do Windows and Forms Authentication in MVC? (50 Minutes) Lab 17 : - How can we use MVC areas for better modular development ? (10 Minutes) Lab 18 :- How to implement MVC with Angular ? (60 minutes) ? Lab 19 :- Can we Overload MVC Action methods ? (10 Minutes) Lab 20 :- How to improve Reusability using Angular ? (20 Minutes) ? Lab 21 :- What is the need of WebAPI in MVC ? (30 Minutes) Lab 22 : - How to do exception handling in MVC? (30 Minutes) Lab 23 :- How to do update and delete using MVC , WebAPI , EF and Angular? (30 Minutes) Lab 24 : - How to use MVC Webgrid?(30 minutes) Lab 25 :- How to implement Validation using Angular and MVC (30 minutes)? Lab 26 :- What is SPA (Single page application)? Lab 27 :- How to Organize MVC project and Understanding CORS issue ? (42 minutes) Lab 28 :- Explain the importance of DisplayModes ? (10 minutes) Lab 29 :- How to do unit testing with MVC projects (30 minutes)? Lab 30 :- How to implement SPA using Angular Routing ? Lab 31 :- How to create decoupled systems using MVC DI ? Lab 32 :- How can we have multiple submit buttons in ASP.NET MVC ? Lab 33 : - What is the importance of AntiForgery in MVC? Lab 34 :- What is the importance of ValidateInput and AllowHTML in MVC? Visit us at www.questpond.com for more details
@naeemahmad9698
@naeemahmad9698 9 жыл бұрын
.NET Interview Preparation videos sir from where i can get complete video series please guide
@dnfvideo
@dnfvideo 8 жыл бұрын
+Naeem Ahmad Please visit www.questpond.com and mail to us on questpond@questpond.com
@multanimohsin8800
@multanimohsin8800 9 жыл бұрын
where is the lab 9
@mayanksingh3277
@mayanksingh3277 7 жыл бұрын
hi
@dnfvideo
@dnfvideo 7 жыл бұрын
Hello
@donfeto7636
@donfeto7636 5 жыл бұрын
information are not complete you give so little info
@prashantkumar15689
@prashantkumar15689 4 жыл бұрын
In case of view bag you set another variable and tried to get value from wrong variable. Don't try to confuse viewers and don't anything wrong. Concept is right what you said but demonstrated wrongly.
@s3123ww
@s3123ww Жыл бұрын
@questpond : Now, We can pass data from controller to view using Tempdata. Please remove your old videoz, i beg. Outdated information can be harmful to your brand.
@bjblk1
@bjblk1 8 жыл бұрын
Excellent video. Thank you very much. I will eventually watch all of your videos.
@bjblk1
@bjblk1 8 жыл бұрын
Excellent video. Thank you very much. I will eventually watch all of your videos.
Post vs Put
23:43
.NET Interview Preparation videos
Рет қаралды 93 М.
c# (Csharp) and .NET :- Difference between IEnumerable and IEnumerator.
13:39
.NET Interview Preparation videos
Рет қаралды 493 М.
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 31 МЛН
Why ASP.NET MVC and MVC vs WebForms ? ( Learn MVC  5 series)
28:57
.NET Interview Preparation videos
Рет қаралды 249 М.
MVC Training :- How to implement forms authentication in MVC (Model View Controller) applications ?
18:21
What are MVC Asynch controllers and thread starvation ? ( MVC interview questions with answers)
13:04
TempData in ASP NET Core
9:35
kudvenkat
Рет қаралды 23 М.
Can we overload MVC Action methods ? ( MVC interview questions)
6:41
.NET Interview Preparation videos
Рет қаралды 63 М.
Interface in C#
38:55
.NET Interview Preparation videos
Рет қаралды 162 М.