Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Part 33 Html helpers in mvc

Автор: kudvenkat

Загружено: 2013-06-08

Просмотров: 193965

Описание:

In this video, we will discuss
1. The purpose of html helpers
2. Some of the standard html helpers

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.
   / @aarvikitchen5572  

What is an HTML helper?
An HTML helper is a method that is used to render html content in a view. HTML helpers are implemented as extension methods.

For example, to produce the HTML for a textbox with id="firstname" and name="firstname", we can type all the html in the view as shown below
[input type="text" name="firtsname" id="firstname" /]

OR

We can use the "TextBox" html helper.
@Html.TextBox("firstname")

There are several overloaded versions. To set a value, along with the name, use the following overloaded version.
@Html.TextBox("firstname", "John")

The above html helper, generates the following HTML
[input id="firstname" name="firstname" type="text" value="John" /]

To set HTML attributes, use the following overloaded version. Notice that, we are passing HTML attributes (style & title) as an anonymous type.
@Html.TextBox("firstname", "John", new { style = "background-color:Red; color:White; font-weight:bold", title="Please enter your first name" })
Some of the html attributes, are reserved keywords. Examples include class, readonly etc. To use these attributes, use "@" symbol as shown below.
@Html.TextBox("firstname", "John", new { @class = "redtextbox", @readonly="true" })

To generate a label for "First Name"
@Html.Label("fisrtname", "First Name")

To generate a textbox to enter password, so that the input is masked
@Html.Password("Password")

To generate a multi-line textbox with 5 rows and 20 columns
@Html.TextArea("Comments", "", 5, 20, null)

To generate a hidden textbox
@Html.Hidden("id")

Hidden textbox is used to store id values. Id values are not displayed on the page to the end user, but we need them to update data when the form is posted to the server.

Is it possible to create our own custom html helpers?
Yes, we will discuss this in a later video session.

Is it mandatory to use HTML helpers?
No, you can type the required HTML, but using HTML helpers will greatly reduce the amount of HTML that we have to write in a view. Views should be as simple as possible. All the complicated logic to generate a control can be encapsulated into the helper, to keep views simple.

Text version of the video
http://csharp-video-tutorials.blogspo...

Slides
http://csharp-video-tutorials.blogspo...

All ASP .NET MVC Text Articles
http://csharp-video-tutorials.blogspo...

All ASP .NET MVC Slides
http://csharp-video-tutorials.blogspo...

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenka...

All Dot Net and SQL Server Tutorials in Arabic
   / kudvenkatarabic  

Part 33   Html helpers in mvc

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Part 34   Generating a dropdownlist control in mvc using HTML helpers

Part 34 Generating a dropdownlist control in mvc using HTML helpers

How do SQL Indexes Work

How do SQL Indexes Work

Part 47   Displaying images in asp net mvc

Part 47 Displaying images in asp net mvc

Tag helpers in asp net core

Tag helpers in asp net core

Резкое послание Москве / Такое произошло впервые!

Резкое послание Москве / Такое произошло впервые!

Что с Кадыровым, Иран: разгром протеста, Суд над Тимошенко. Крутихин, Фейгин, Айсин

Что с Кадыровым, Иран: разгром протеста, Суд над Тимошенко. Крутихин, Фейгин, Айсин

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

Заявление Путина о завершении войны / Москва ждёт ответа США

Заявление Путина о завершении войны / Москва ждёт ответа США

Лучшая Музыка 2026🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно 2026 #23

Лучшая Музыка 2026🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно 2026 #23

Гости из будущего - Лучшие песни - The Best @MELOMAN-MUSIC

Гости из будущего - Лучшие песни - The Best @MELOMAN-MUSIC

Part 52   Partial views in mvc

Part 52 Partial views in mvc

Учим HTML и CSS за 7 часов! Уроки по созданию сайтов Полный курс HTML и CSS с нуля до профессионала

Учим HTML и CSS за 7 часов! Уроки по созданию сайтов Полный курс HTML и CSS с нуля до профессионала

Музыка лечит сердце и сосуды🌸 Успокаивающая музыка восстанавливает нервную систему,расслабляющая

Музыка лечит сердце и сосуды🌸 Успокаивающая музыка восстанавливает нервную систему,расслабляющая

HTML - Полный Курс HTML Для Начинающих [3 ЧАСА]

HTML - Полный Курс HTML Для Начинающих [3 ЧАСА]

Вся база SQL для начинающих за 1 час

Вся база SQL для начинающих за 1 час

Música para Tiendas, Locales de Ropa, Bares, Restaurantes - Musica para trabajar activo y alegre mix

Música para Tiendas, Locales de Ropa, Bares, Restaurantes - Musica para trabajar activo y alegre mix

Docker за 20 минут

Docker за 20 минут

Part 10  Working with multiple tables in mvc

Part 10 Working with multiple tables in mvc

(#12) Strongly type HTML helpers in MVC 5 |  MVC 5 tutorial step by step in Hindi

(#12) Strongly type HTML helpers in MVC 5 | MVC 5 tutorial step by step in Hindi

Part 24  Deleting database records using post request in mvc

Part 24 Deleting database records using post request in mvc

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com