---
title: "HTML Helpers in MVC"  
description: "In this blog I am trying to explain the concept of HTML Helpers  In MVC, HTML helpers are much like traditional ASP.NET Web Form controls. Just like w"  
author: "Vijay Shukla"  
published: 2013-09-26  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/589/html-helpers-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 2 minutes  

---

# HTML Helpers in MVC

In this blog I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to [explain the concept](https://www.mindstick.com/forum/159605/explain-the-concept-of-unique-key-violation-error) of [HTML Helpers](https://www.mindstick.com/forum/33951/how-to-use-html-helpers-in-mvc)\

In MVC, HTML helpers are much like [traditional ASP.NET](https://www.mindstick.com/forum/158582/what-is-asp-dot-net-mvc-and-how-does-it-differ-from-traditional-asp-dot-net) Web Form controls. Just like web form [controls in ASP.NET](https://www.mindstick.com/forum/345/grid-controls-in-asp-dot-net-mvc), HTML helpers are used to modify HTML. But HTML helpers are more lightweight. Unlike Web Form controls, an [HTML helper](https://www.mindstick.com/forum/155772/how-we-create-custom-html-helper-in-asp-dot-net-mvc) does not have an event model and a view state.

In most cases, an HTML helper is just a method that returns a string.

With MVC, you can create your own helpers, or use the built in HTML helpers.

##### Standard HTML Helpers

MVC includes standard helpers for the most common types of [HTML elements](https://www.mindstick.com/forum/158688/how-can-you-dynamically-create-html-elements-using-jquery), like HTML links and HTML form elements.

##### HTML Links

The simplest way to render an HTML link in is to use the [HTML.ActionLink](https://www.mindstick.com/forum/157896/what-is-the-difference-between-the-html-actionlink-and-ajax-actionlink-helpers-in-asp-dot-net-mvc)() helper.

In MVC, the Html.ActionLink() don’t link to a view. It creates a link to a [controller action](https://www.mindstick.com/forum/12778/how-to-send-data-from-view-to-controller-action-in-asp-dot-net-mvc).

[Razor Syntax](https://www.mindstick.com/forum/160235/what-is-razor-syntax-and-how-does-it-help-in-embedding-server-side-code-within-a-view):

```
@Html.ActionLink("Go To Home", " Home ")
```

The Html.ActionLink() helper as many properties:

##### Property Description

.linkText The link text (label)

.actionName The target action

.routeValues The values passed to the action

.controllerName The target controller

.htmlAttributes The set of attributes to the link

.protocol The link protocol

.hostname The host name for the link

.fragment The anchor target for the link

Note: You can pass values to a controller action. For example, you can pass the id of a database record to a database edit action:

##### Razor Syntax C#:

```
@Html.ActionLink("Edit Record", "Edit", new {Id=3})
Razor Syntax VB:@Html.ActionLink("Edit Record", "Edit", New With{.Id=3})The Html.ActionLink() helper above, outputs the following HTML:<a href="/Home/Edit/3">Edit Record</a>
```

---

Original Source: https://www.mindstick.com/blog/589/html-helpers-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
