Part 5 Views in an mvc application

preview_player
Показать описание
Text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

Slides

All ASP .NET MVC Text Articles

All ASP .NET MVC Slides

ASP.NET MVC Playlist

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

In this video we will discuss views. Please watch Part 4 of MVC tutorial before proceeding. Let's change the Index() method in HomeController to return a list of country names. Since country names are strings, return List of strings. Get rid of id and name parameters.

Run the application and notice that the output is not as expected.
System.Collections.Generic.List`1[System.String]

To correct this problem, let's add a view to our project.
1. Right click on the Index() function
2. Click on "Add View"
3. Notice that, the view name in "Add View" dialog box matches the name of the controller action method
4. Select "Razor" as the view engine
5. Leave the rest of the defaults as is, and click "Add" button

We will discuss ViewBag & ViewData, and the differences between them in our next video session. For now, understand that, ViewBag & ViewData is a mechanism to pass data from the controller to the view.

Please Note: To pass data from controller to a view, It's always a good practice to use strongly typed view models instead of using ViewBag & ViewData. We will discuss view models in a later video session.

Please Note: We use "@" symbol to switch between html and c# code. We will discuss razor views and their syntax in a later video session.
Рекомендации по теме
Комментарии
Автор

Whoever is giving a thumbs down does not realize the value of what you are sharing. Your tutorials are great!

CondeNastCruiser
Автор

what would I do without these tutorials... I'm on an internship and all of a sudden the company's asking for everything to be made on MVC and I'm like: what's an MVC? lol XD

thank you BTW ;)

wishingWL
Автор

This is amazing Venkat! 5 years later and still these tutorials are very helpful! Thank you:)

giridharamadhavan
Автор

Trust me these MVC series videos are the best across whole internet. I have tried many other trainers as well but no one can match these. Thank you sooo much!

prdas
Автор

Thank you very much for taking time to give feedback. In the description of this video, I have included the link for ASP .NET, C#, and SQL Server playlists. All the videos are arranged in logical sequence in these playlists, which could be useful to you. Please share the link with your friends who you think would also benefit from them. If you like these videos, please click on the THUMBS UP button below the video. For email alerts, when new videos are uploaded, you may subscribe to my channel.

Csharp-video-tutorialsBlogspot
Автор

Great!! You really knows to how to transfer knowledge to a lay man.

kamaljkhan
Автор

I've been doing webforms for a couple of years. Always heard of MVC but never actually tried it out. It seems like a way better way to create webforms than a webforms project. Now add Kudevenkat's amazing teaching ways. Thank you for all you do you empower all your viewers.

CesarQuinteros
Автор

Your training is wonderful! Thank you for knowing what people need to know and presenting it in a very useful and practical way. Your understanding of how people think is great!!

playing
Автор

I am not a software engineer but I could clearly understand what you are teaching. you must be a great teacher. thanks for uploading your videos.

settyar
Автор

I am always thankful that our world have person like you. Intelligent, kind, positive, determined to help ...

ewnetuyelekal
Автор

Dear Venkat, Your tutorials are awesome, any layman can learn any damn technology with your tutorials for sure. Your videos are very precise, clean and neatly presented. Your voice is + point to your videos. Keep up the good work. I'm great fan of your tutorials. Thanks for sharing all these free on youtube.

UmeshKumar-oxzp
Автор

Venkat, the way you explain things is very easy to understand. Simply awesome videos. Great work man !

hassanarafat
Автор

THANK YOU SO MUCH VENKAT. MUCH LOVE!!

fika.newyork
Автор

I love your tutorial a thousand times. Your voice is also very clear and slow enough for me to comfortably follow !!!

MinhPham-xcqn
Автор

First, who explained me, how MVC works. Ty!!!

marekhelak
Автор

you are just awesome.. keep good work going.
you are a boon for us. may you have all success. god bless!!

ITsEuphoriaUnplugged
Автор

amazing amazing amazing videos and tutorials, thanks a million for your hard work, i really appreciate it

USAmaghrebiya
Автор

Many many thanks to you sir, your tutorials have really improved my programming skills.

olasunkanmifelixoyadokun
Автор

u really great....!!!
well explained, even a bee can learning MVC using ur tutorials...
Thank you soooo much....

vipintp
Автор

Only legends can share the Knowledge.. You are role model to everyone sir...Keep going

irfanpathan