У нас вы можете посмотреть бесплатно DisplayNameFor – DisplayFor – ActionLink & Data Annotation – Session 33 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
During this session of ASP.NET Core Tutorial (ASP.NET 5.0), we introduce DisplayNameFor, DisplayFor and ActionLink Html Hepler, then we will discuss about Data Annotation. Also, we will create another View with the above mentioned Html Helpers and change properties’ label and data format in the view with Data Annotation. DisplayFor & DisplayNameFor These two Html Heplers are responsible for showing labels and values of Model Properties inside the View. DisplayNameFor is showing property’s label and DisplayFor is presenting property’s value inside the view. Both helpers are bound to the properties of the View Model with Lambda Expression. Also we can change the property’s label and the format of value data with Data Annotation that we will discuss later in this session. We continue to develop our project that we have been working throughout this tutorial. Thus, we return a View with name of “View” as a result of CreateStronglyTypedView Action Method with Post Method and pass the submitted data to the view. Then, we create another strongly typed view with name of “View” in Views/Cost folder and bind it to CreateCostViewModel with model directive. Afterward, we can present the submitted data with DisplayNameFor and DisplayFor Html Helper. ActionLink This Html Helper, helps us to create [a][/a] tag that link us to respective controller and action method. ActionLink has several versions of Overloaded that we can select the proper one based on our needs. But in this session we use the version which includes link label, action method name and controller name. Bear in mind, if target of the link and the location of the link are in the same controller, we can omit controller name part and use another overloaded version. Data Annotation This tool is located in “System.ComponentModel.DataAnnotations” namespace and enable us to validate models and forms. Also, we can use Data Annotation to apply our required rules on the model and change properties’ label and data format then ASP.NET will take care of enforcing them and displaying appropriate messages to user. We can decorate our property with [Display(Name=””)] to change property’s label. Also, we can change Date Format with [DisplayFormat(DataFormatString =””)] data annotation. Moreover, we can show proper message to user for null properties. For instance, if we choose “Select a Category” which has value of null as Category, then, in the view we have null value in front of Category field. But if we decorate Category field with [DisplayFormat(NullDisplayText =”Category Not Selected”)] we will have this message if user choose “Select a Category” as Category option. Format types in .NET https://docs.microsoft.com/en-us/dotn... Standard date and time format strings https://docs.microsoft.com/en-us/dotn... Tutorial Playlist https://bit.ly/3lxQP9n Our Social Media Facebook: https://bit.ly/310ksqA Instagram: https://bit.ly/3cOq4th Telegram: https://bit.ly/3s4mzWc Text Version of course: https://www.goldencourses.net/display...