--- uid: mvc/overview/older-versions-1/views/creating-custom-html-helpers-cs title: "Creating Custom HTML Helpers (C#) | Microsoft Docs" author: microsoft description: "The goal of this tutorial is to demonstrate how you can create custom HTML Helpers that you can use within your MVC views. By taking advantage of HTML Helper..." ms.author: riande ms.date: 10/07/2008 ms.assetid: e454c67d-a86e-4119-a858-eb04bbec2dff msc.legacyurl: /mvc/overview/older-versions-1/views/creating-custom-html-helpers-cs msc.type: authoredcontent uid: aspnet/mvc/overview/older-versions-1/views/creating-custom-html-helpers-cs --- Creating Custom HTML Helpers (C#) ==================== by [Microsoft](https://github.com/microsoft) [Download PDF](http://download.microsoft.com/download/1/1/f/11f721aa-d749-4ed7-bb89-a681b68894e6/ASPNET_MVC_Tutorial_9_CS.pdf) > The goal of this tutorial is to demonstrate how you can create custom HTML Helpers that you can use within your MVC views. By taking advantage of HTML Helpers, you can reduce the amount of tedious typing of HTML tags that you must perform to create a standard HTML page. The goal of this tutorial is to demonstrate how you can create custom HTML Helpers that you can use within your MVC views. By taking advantage of HTML Helpers, you can reduce the amount of tedious typing of HTML tags that you must perform to create a standard HTML page. In the first part of this tutorial, I describe some of the existing HTML Helpers included with the ASP.NET MVC framework. Next, I describe two methods of creating custom HTML Helpers: I explain how to create custom HTML Helpers by creating a static method and by creating an extension method. ## Understanding HTML Helpers An HTML Helper is just a method that returns a string. The string can represent any type of content that you want. For example, you can use HTML Helpers to render standard HTML tags like HTML `` and `` tags. You also can use HTML Helpers to render more complex content such as a tab strip or an HTML table of database data. The ASP.NET MVC framework includes the following set of standard HTML Helpers (this is not a complete list): - Html.ActionLink() - Html.BeginForm() - Html.CheckBox() - Html.DropDownList() - Html.EndForm() - Html.Hidden() - Html.ListBox() - Html.Password() - Html.RadioButton() - Html.TextArea() - Html.TextBox() For example, consider the form in Listing 1. This form is rendered with the help of two of the standard HTML Helpers (see Figure 1). This form uses the `Html.BeginForm()` and `Html.TextBox()` Helper methods to render a simple HTML form. [![Page rendered with HTML Helpers](creating-custom-html-helpers-cs/_static/image2.png)](creating-custom-html-helpers-cs/_static/image1.png) **Figure 01**: Page rendered with HTML Helpers ([Click to view full-size image](creating-custom-html-helpers-cs/_static/image3.png)) **Listing 1 – `Views\Home\Index.aspx`** [!code-aspx[Main](creating-custom-html-helpers-cs/samples/sample1.aspx)] The Html.BeginForm() Helper method is used to create the opening and closing HTML `