(#33) ViewData in Asp.Net Core | Pass data from View to Layout | Asp.Net Core tutorial

preview_player
Показать описание
Asp.Net Core Tutorial: What is ViewData in Asp.Net Core and how to pass data from view to layout file?
In this video, we will learn each detail of ViewData. ViewData is a property of controller class with ViewDataDictionaryType and is used to pass data from the controller's action method to the corresponding view. Here is the general syntax of using ViewData.
ViewData["propertyName"] = data;
ViewData can also be used to pass data from view to its Layout file. For example, we need to set titles dynamically based on the current page. Hence we can use ViewData to pass data from view to its layout file.
We can simply set the data on the view file and can use the same ViewData on the layout file by using razor syntax.

#ViewData #PassDataFromViewToLayout #Nitish

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Follow us on
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Popular free courses from WebGentle
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Рекомендации по теме
Комментарии
Автор

You are awsome teacher because you provide deep and step by step concept knowledge 👍👍👍👍

hamzavlog
Автор

Thank you friend. I solved my problem thanks to you.

navorski
Автор

Indian guys are always saving my ass 🤟 thanks brother

henrig
Автор

Hi can u help me with a step-by-step on how to create a triplogapp

dorisjjabbah
Автор

i have a question... how u get model in book page for book title....viewdata

sameerfromfsd
Автор

Please provide tutorials of data grid inline editing .

sandeepkumar-czqb
Автор

Why do we want to send data from controller to view? any use cases..

haripoudel
Автор

Brother aik complete Asp.net core ka project bhi hona chahiye step by step....phir ap ki mehnat ka sahi phal mily apko bhi aur sab ko. Jab aik project ko karen gy tu sahi pata chaly ga tmam cheezo ko sahi use karne ka.

Aliimran-zmyy