---
title: "HTML helpers and Partial Views"  
description: "Hi everyone in this blog I’m explaining about HTML helpers and Partial views.HTML Helper:An HTML Helper is just a method that returns a string. The st"  
author: "Anonymous User"  
published: 2015-03-11  
updated: 2018-02-22  
canonical: https://www.mindstick.com/blog/10833/html-helpers-and-partial-views  
category: "asp.net mvc"  
tags: ["html", "view"]  
reading_time: 3 minutes  

---

# HTML helpers and Partial Views

Hi everyone in this blog I’m explaining about [HTML helpers](https://www.mindstick.com/blog/589/html-helpers-in-mvc) and [Partial views](https://www.mindstick.com/interview/33672/what-are-partial-views-in-mvc).

#### HTML Helper:

##

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 <input> and <img> 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 following are some of the standard HTML Helpers already included in ASP.NET MVC:**

1. Html.ActionLink()
2. Html.BeginForm()
3. Html.CheckBox()
4. Html.DropDownList()
5. Html.EndForm()
6. Html.Hidden()
7. Html.ListBox()
8. Html.Password()
9. Html.RadioButton()
10. Html.TextArea()
11. Html.TextBox()

#### Partial View:

##

[Partial view](https://www.mindstick.com/articles/1132/auto-refresh-partial-view-in-asp-dot-net-mvc) is special view which renders a portion of view content. It is just like a [user control](https://www.mindstick.com/forum/294/problem-in-access-the-control-inside-the-user-control) web [form application](https://www.mindstick.com/forum/34200/system-data-sqlclient-sqlexception-occurred-while-using-checked-or-radio-button-in-form-application). Partial can be reusable in multiple views. It helps us to reduce code duplication. In other word a partial view enables us to render a view within the parent view.

The partial view is instantiated with its own copy of a ViewDataDictionary object which is available with the parent view so that partial view can [access the data](https://answers.mindstick.com/qa/40056/what-is-the-weo-update-and-how-can-i-access-the-data) of the parent view. If we made the change in this data (ViewDataDictionary object), the parent view's data is not affected. Generally, the Partial rendering method of the view is used when [related data](https://www.mindstick.com/interview/22990/what-is-lazy-eager-and-explicit-loading-of-related-data-in-entity-frameworks) that we want to render in a partial view is part of our model.

HTML Helpers- are for [reusable components](https://www.mindstick.com/forum/160236/how-to-create-reusable-components-or-templates-in-razor-views). Web Grid, Pager, etc. These are distributed as assemblies and have no dependency on Razor. Choose this if:

1. Functionality is truly reusable and applicable to any application
2. You don't want people to modify it, want to version it

Partials Views: are a way to split large views into smaller parts to keep things more manageable. They are also useful for reusability that is specific to [your application](https://www.mindstick.com/forum/34702/please-tell-me-what-is-cross-site-scripting-and-how-is-it-harmful-for-your-application). These are located by the view engine, so you can have the same partial defined in different places (e.g. Views/Shared), allowing you to customize per controller, area or [display mode](https://www.mindstick.com/interview/2206/what-is-the-use-of-display-modes). Choose this if:

1. Functionality is application-specific
2. Want to customize per controller, area or display mode

Local Helpers: are a way to execute the same template many times, without having to repeat yourself. You can also use it to break views into parts to avoid deep nesting, but keeping everything in the same file. Choose this if:

1. Functionality is view-specific

**Application Helpers: (in App_Code) are a mix between local helpers and HTML helpers. Choose this if:**

1. Prefer Razor over TagBuilder
2. Don't mind distributing files instead of assemblies
3. Prefer type-safe method-call syntax instead of @Html.Partial(name)

---

Original Source: https://www.mindstick.com/blog/10833/html-helpers-and-partial-views

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
