Please describe to me about HTML helper in asp.net MVC with example.
What is HTML Helpers in Asp.Net MVC?
34603-Feb-2020
Updated on 03-Feb-2020
Home / DeveloperSection / Forums / What is HTML Helpers in Asp.Net MVC?
Please describe to me about HTML helper in asp.net MVC with example.
Nishi Tiwari
03-Feb-2020HTML Helpers in Asp.Net MVC
We understand what the HTML helper in asp.net MVC is
The one of the basic things of any web application is to render HTML as an output. We have ASP.NET Webforms and ASP.NET MVC framework both will render HTML very well but they do this thing in a different way.
If they will come from ASP.NET webforms development background then we will think ASP.NET Webforms is better as compare to ASP.NET MVC because here we need to write the bulk of HTML which will get rendered in the browser and writing the whole HTML will make developers bit crazy. The ASP.NET MVC came up with HTML Helpers which will help us to render HTML in the browser.
HTML helpers and server controls are the same and both are used to render HTML on browser but if we use HTML helpers we not need ViewState to maintain its state but server controls will use ViewState to maintain its state and data.
The list of HTML helper methods available in asp.net MVC are given below:-
1. @Html.BeginForm
2. @Html.EndForm
3. @Html.TextBox
4. @Html.TextArea
5. @Html.Password
6. @Html.Hidden
7. @Html.CheckBox
8. @Html.RadioButton
9. @Html.DropDownList
10. @Html.ListBox