---
title: "Describe the different types of HTML helpers available in ASP.NET MVC."  
description: "Describe the different types of HTML helpers available in ASP.NET MVC."  
author: "Revati S Misra"  
published: 2023-06-01  
updated: 2023-06-01  
canonical: https://www.mindstick.com/forum/158591/describe-the-different-types-of-html-helpers-available-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc", "mvc"]  
reading_time: 3 minutes  

---

# Describe the different types of HTML helpers available in ASP.NET MVC.

[Describe](https://www.mindstick.com/interview/12752/what-is-ddms-describe-some-of-its-capabilities) the different types of [HTML helpers](https://www.mindstick.com/blog/589/html-helpers-in-mvc) available in [ASP.NET MVC](https://www.mindstick.com/forum/155798/what-is-caching-in-asp-dot-net-mvc).

## Replies

### Reply by Aryan Kumar

There are two types of [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) helpers available in [ASP.NET](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) MVC:

- **Standard HTML helpers:** These helpers render standard HTML elements, such as text boxes, check boxes, and radio buttons.
- **Custom HTML helpers:** These helpers render custom HTML elements, such as tabs, accordions, and modal windows.

Standard HTML helpers are included in the ASP.NET MVC framework. Custom HTML helpers can be created by developers.

Here are some of the most commonly used standard HTML helpers:

- **TextBox:** Renders a text box.
- **CheckBox:** Renders a check box.
- **RadioButton:** Renders a radio button.
- **DropDownList:** Renders a drop-down list.
- **ListBox:** Renders a list box.
- **Hidden:** Renders a hidden input field.
- **Label:** Renders a label.
- **Image:** Renders an image.
- **Anchor:** Renders an anchor tag.

Here are some examples of how standard HTML helpers can be used:

Code snippet

```plaintext
@Html.TextBoxFor(x => x.Name)
@Html.CheckBoxFor(x => x.IsEnabled)
@Html.RadioButtonFor(x => x.Gender, "Male")
@Html.DropDownListFor(x => x.FavoriteColor, Model.Colors)
@Html.ListBoxFor(x => x.SelectedProducts, Model.Products)
@Html.HiddenFor(x => x.Id)
@Html.LabelFor(x => x.Name)
@Html.Image("~/Images/Logo.png")
@Html.ActionLink("Home", "Index", "Home")
```

Custom HTML helpers can be created by developers to render custom HTML elements. Custom HTML helpers can be used to improve the look and feel of an ASP.NET MVC application, or to add new functionality to an application.

To create a custom HTML helper, developers can use the following steps:

1. Create a new class that inherits from the HtmlHelper class.
2. Add an extension method to the class that renders the custom HTML element.
3. Register the custom HTML helper with the application.

Here is an example of a custom HTML helper that renders a tab:

Code snippet

```plaintext
public class TabHelper : HtmlHelper
{
    public static IHtmlString Tab(this HtmlHelper htmlHelper, string title, string content)
    {
        var html = new TagBuilder("li");
        html.Attributes["class"] = "tab";
        html.InnerHtml = title;

        var contentHtml = new TagBuilder("div");
        contentHtml.Attributes["class"] = "tab-content";
        contentHtml.InnerHtml = content;

        return MvcHtmlString.Create(html.ToString() + contentHtml.ToString());
    }
}
```

This custom HTML helper can be used in a view as follows:

Code snippet

```plaintext
@Html.Tab("Home", Html.RenderAction("Index", "Home"))
@Html.Tab("Products", Html.RenderAction("Index", "Products"))
@Html.Tab("About", Html.RenderAction("Index", "About"))
```

This will render the following HTML:

Code snippet

```plaintext
<li class="tab">Home</li>
<li class="tab">Products</li>
<li class="tab">About</li>
```

The content of the tabs will be rendered by the Index action methods in the Home, Products, and About controllers.


---

Original Source: https://www.mindstick.com/forum/158591/describe-the-different-types-of-html-helpers-available-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
